mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 19:05:52 +00:00
Improved/simplified TCL bindings
This commit is contained in:
parent
83c743f717
commit
97f783e668
3 changed files with 57 additions and 40 deletions
|
@ -56,8 +56,6 @@ void Pass::run_register()
|
|||
{
|
||||
assert(pass_register.count(pass_name) == 0);
|
||||
pass_register[pass_name] = this;
|
||||
|
||||
register_tcl();
|
||||
}
|
||||
|
||||
void Pass::init_register()
|
||||
|
@ -77,25 +75,6 @@ void Pass::done_register()
|
|||
raw_register_done = false;
|
||||
}
|
||||
|
||||
#ifdef YOSYS_ENABLE_TCL
|
||||
static int tcl_pass(ClientData that_vp, Tcl_Interp*, int argc, const char *argv[])
|
||||
{
|
||||
Pass *that = (Pass*)that_vp;
|
||||
std::vector<std::string> args;
|
||||
for (int i = 0; i < argc; i++)
|
||||
args.push_back(argv[i]);
|
||||
that->call(yosys_tcl_design, args);
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
void Pass::register_tcl()
|
||||
{
|
||||
#ifdef YOSYS_ENABLE_TCL
|
||||
Tcl_CreateCommand(yosys_tcl, pass_name.c_str(), tcl_pass, (ClientData)this, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
Pass::~Pass()
|
||||
{
|
||||
}
|
||||
|
@ -212,8 +191,6 @@ void Frontend::run_register()
|
|||
|
||||
assert(frontend_register.count(frontend_name) == 0);
|
||||
frontend_register[frontend_name] = this;
|
||||
|
||||
register_tcl();
|
||||
}
|
||||
|
||||
Frontend::~Frontend()
|
||||
|
@ -306,8 +283,6 @@ void Backend::run_register()
|
|||
|
||||
assert(backend_register.count(backend_name) == 0);
|
||||
backend_register[backend_name] = this;
|
||||
|
||||
register_tcl();
|
||||
}
|
||||
|
||||
Backend::~Backend()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue