Added Pass:call_newsel API
authorClifford Wolf <clifford@clifford.at>
Mon, 2 Dec 2013 11:17:04 +0000 (12:17 +0100)
committerClifford Wolf <clifford@clifford.at>
Mon, 2 Dec 2013 11:17:04 +0000 (12:17 +0100)
kernel/register.cc
kernel/register.h

index e02fc8fc0415868f19509aef6765cb0c34d1e4ce..949d7c628e0c1974837268265408b21ae88c8787 100644 (file)
@@ -182,6 +182,30 @@ void Pass::call(RTLIL::Design *design, std::vector<std::string> 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<std::string> 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)
 {
 }
index 4dd86cf3d47290dfdf931698fb17f84a4916d4bf..3165d2bf8e4b49a1e8f885192e90afa78561df39 100644 (file)
@@ -55,6 +55,9 @@ struct Pass
        static void call(RTLIL::Design *design, std::string command);
        static void call(RTLIL::Design *design, std::vector<std::string> args);
 
+       static void call_newsel(RTLIL::Design *design, std::string command);
+       static void call_newsel(RTLIL::Design *design, std::vector<std::string> args);
+
        static void init_register();
        static void done_register();
 };