mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
commands can now be run on arbitrary designs, not only on the active one
This commit is contained in:
parent
8ebaeecd83
commit
da8083dbd0
1 changed files with 10 additions and 0 deletions
|
@ -161,6 +161,13 @@ namespace YOSYS_PYTHON {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void run(std::string command)
|
||||
{
|
||||
Yosys::RTLIL::Design* cpp_design = get_cpp_obj();
|
||||
if(cpp_design != NULL)
|
||||
Yosys::run_pass(command, cpp_design);
|
||||
}
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &ostr, const Design &design)
|
||||
|
@ -184,8 +191,11 @@ namespace YOSYS_PYTHON {
|
|||
using namespace boost::python;
|
||||
|
||||
class_<Design>("Design", init<unsigned int>())
|
||||
.def(boost::python::self_ns::str(boost::python::self_ns::self))
|
||||
.def(boost::python::self_ns::repr(boost::python::self_ns::self))
|
||||
.def(init<>())
|
||||
.def("get_modules", &Design::get_modules)
|
||||
.def("run",&Design::run)
|
||||
;
|
||||
|
||||
class_<Module>("Module", no_init)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue