diff options
author | Benedikt Tutzer <e1225461@student.tuwien.ac.at> | 2018-07-09 16:01:56 +0200 |
---|---|---|
committer | Benedikt Tutzer <e1225461@student.tuwien.ac.at> | 2018-07-09 16:01:56 +0200 |
commit | da8083dbd07404fb765e0ffebed6f5477b6d99ad (patch) | |
tree | d1dfd3783f950c58d85f1c40cb015caf5d136a14 | |
parent | 8ebaeecd83b22db5c196356844f01ce69d0b4bea (diff) | |
download | yosys-da8083dbd07404fb765e0ffebed6f5477b6d99ad.tar.gz yosys-da8083dbd07404fb765e0ffebed6f5477b6d99ad.tar.bz2 yosys-da8083dbd07404fb765e0ffebed6f5477b6d99ad.zip |
commands can now be run on arbitrary designs, not only on the active one
-rw-r--r-- | kernel/python_wrappers.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/python_wrappers.cc b/kernel/python_wrappers.cc index c778f3919..04aebb1b8 100644 --- a/kernel/python_wrappers.cc +++ b/kernel/python_wrappers.cc @@ -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) |