From: Clifford Wolf Date: Mon, 2 Dec 2013 11:17:04 +0000 (+0100) Subject: Added Pass:call_newsel API X-Git-Tag: yosys-0.2.0~272 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a66ca0472a171ecbdf9a99771129eb0f28aa55ac;p=yosys.git Added Pass:call_newsel API --- diff --git a/kernel/register.cc b/kernel/register.cc index e02fc8fc0..949d7c628 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -182,6 +182,30 @@ void Pass::call(RTLIL::Design *design, std::vector args) design->check(); } +void Pass::call_newsel(RTLIL::Design *design, std::string command) +{ + std::string backup_selected_active_module = design->selected_active_module; + design->selected_active_module.clear(); + design->selection_stack.push_back(RTLIL::Selection()); + + Pass::call(design, command); + + design->selection_stack.pop_back(); + design->selected_active_module = backup_selected_active_module; +} + +void Pass::call_newsel(RTLIL::Design *design, std::vector args) +{ + std::string backup_selected_active_module = design->selected_active_module; + design->selected_active_module.clear(); + design->selection_stack.push_back(RTLIL::Selection()); + + Pass::call(design, args); + + design->selection_stack.pop_back(); + design->selected_active_module = backup_selected_active_module; +} + Frontend::Frontend(std::string name, std::string short_help) : Pass("read_"+name, short_help), frontend_name(name) { } diff --git a/kernel/register.h b/kernel/register.h index 4dd86cf3d..3165d2bf8 100644 --- a/kernel/register.h +++ b/kernel/register.h @@ -55,6 +55,9 @@ struct Pass static void call(RTLIL::Design *design, std::string command); static void call(RTLIL::Design *design, std::vector args); + static void call_newsel(RTLIL::Design *design, std::string command); + static void call_newsel(RTLIL::Design *design, std::vector args); + static void init_register(); static void done_register(); };