From a66ca0472a171ecbdf9a99771129eb0f28aa55ac Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 2 Dec 2013 12:17:04 +0100 Subject: [PATCH] Added Pass:call_newsel API --- kernel/register.cc | 24 ++++++++++++++++++++++++ kernel/register.h | 3 +++ 2 files changed, 27 insertions(+) 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(); }; -- 2.30.2