3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-23 06:01:27 +00:00

opensta: refactor default command

This commit is contained in:
Emil J. Tywoniak 2025-11-14 16:06:46 +01:00
parent a5b6c3cc19
commit 411fc149df
3 changed files with 13 additions and 5 deletions

View file

@ -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 <command>\n");
log(" use <command> to run OpenSTA instead of \"%s\"\n", default_sta_cmd);
log(" use <command> to run OpenSTA instead of \"%s\"\n", default_opensta_cmd);
log("\n");
log(" -sdc-in <filename>\n");
log(" expand SDC input file <filename>\n");
@ -35,7 +35,7 @@ struct OpenstaPass : public Pass
void execute(std::vector<std::string> 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;

View file

@ -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 */

View file

@ -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 <command>\n");
log(" use <command> to run OpenSTA instead of \"%s\"\n", default_sta_cmd);
log(" use <command> to run OpenSTA instead of \"%s\"\n", default_opensta_cmd);
log("\n");
log(" -sdc-in <filename>\n");
log(" expand SDC file <filename>\n");