Add Design.run_pass API

This commit is contained in:
Akash Levy 2025-05-08 07:20:02 -07:00
parent 135570020e
commit c55ee83992
2 changed files with 10 additions and 0 deletions

View File

@ -1254,6 +1254,12 @@ std::vector<RTLIL::Module*> RTLIL::Design::selected_modules(RTLIL::SelectPartial
return result;
}
void RTLIL::Design::run_pass(std::string command) {
log("\n-- Running command `%s' --\n", command.c_str());
Pass::call(this, command);
log_flush();
}
RTLIL::Module::Module()
{
static unsigned int hashidx_count = 123456789;

View File

@ -1446,6 +1446,10 @@ struct RTLIL::Design
// returns all selected unboxed whole modules, warning the user if any
// partially selected or boxed modules have been ignored
std::vector<RTLIL::Module*> selected_unboxed_whole_modules_warn() const { return selected_modules(SELECT_WHOLE_WARN, SB_UNBOXED_WARN); }
// SILIMATE ADDED TO IMPROVE PYOSYS API
void run_pass(std::string command);
#ifdef WITH_PYTHON
static std::map<unsigned int, RTLIL::Design*> *get_all_designs(void);
#endif