diff --git a/techlibs/common/opensta.cc b/techlibs/common/opensta.cc index 6d793b3e1..2a806edf6 100644 --- a/techlibs/common/opensta.cc +++ b/techlibs/common/opensta.cc @@ -1,5 +1,6 @@ #include "kernel/rtlil.h" #include "kernel/log.h" +#include "techlibs/common/opensta.h" USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN @@ -7,7 +8,6 @@ PRIVATE_NAMESPACE_BEGIN #if !defined(YOSYS_DISABLE_SPAWN) struct OpenstaPass : public Pass { - const char* default_sta_cmd = "sta"; OpenstaPass() : Pass("opensta", "run OpenSTA") { } void help() override @@ -19,7 +19,7 @@ struct OpenstaPass : public Pass // TOOD log("\n"); log(" -exe \n"); - log(" use to run OpenSTA instead of \"%s\"\n", default_sta_cmd); + log(" use to run OpenSTA instead of \"%s\"\n", default_opensta_cmd); log("\n"); log(" -sdc-in \n"); log(" expand SDC input file \n"); @@ -35,7 +35,7 @@ struct OpenstaPass : public Pass void execute(std::vector args, RTLIL::Design *design) override { string run_from, run_to; - string opensta_exe = design->scratchpad_get_string("opensta.exe", "sta"); + string opensta_exe = design->scratchpad_get_string("opensta.exe", default_opensta_cmd); string sdc_filename, sdc_expanded_filename; string tempdir_name, script_filename; string verilog_filename, liberty_filename; diff --git a/techlibs/common/opensta.h b/techlibs/common/opensta.h new file mode 100644 index 000000000..4c5ac871f --- /dev/null +++ b/techlibs/common/opensta.h @@ -0,0 +1,8 @@ +#include "kernel/yosys_common.h" +#ifndef OPENSTA_H +YOSYS_NAMESPACE_BEGIN + +static const char* default_opensta_cmd = "sta"; + +YOSYS_NAMESPACE_END +#endif /* OPENSTA_H */ diff --git a/techlibs/common/sdc_expand.cc b/techlibs/common/sdc_expand.cc index cec5e8c1e..95254d1f4 100644 --- a/techlibs/common/sdc_expand.cc +++ b/techlibs/common/sdc_expand.cc @@ -1,12 +1,12 @@ #include "kernel/rtlil.h" #include "kernel/log.h" +#include "techlibs/common/opensta.h" USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN struct SdcExpandPass : public ScriptPass { - const char* default_sta_cmd = "sta"; SdcExpandPass() : ScriptPass("sdc_expand", "run OpenSTA") { } void help() override @@ -18,7 +18,7 @@ struct SdcExpandPass : public ScriptPass // TODO log("\n"); log(" -exe \n"); - log(" use to run OpenSTA instead of \"%s\"\n", default_sta_cmd); + log(" use to run OpenSTA instead of \"%s\"\n", default_opensta_cmd); log("\n"); log(" -sdc-in \n"); log(" expand SDC file \n");