summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-12-02 12:17:04 +0100
committerClifford Wolf <clifford@clifford.at>2013-12-02 12:17:04 +0100
commita66ca0472a171ecbdf9a99771129eb0f28aa55ac (patch)
tree71cff9955f7e3bd73177453848e648a5f6dd1bdc /kernel
parent905eac04f1a16fcc54c92be87242a8a1e8922126 (diff)
Added Pass:call_newsel API
Diffstat (limited to 'kernel')
-rw-r--r--kernel/register.cc24
-rw-r--r--kernel/register.h3
2 files changed, 27 insertions, 0 deletions
diff --git a/kernel/register.cc b/kernel/register.cc
index e02fc8fc..949d7c62 100644
--- a/kernel/register.cc
+++ b/kernel/register.cc
@@ -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)
{
}
diff --git a/kernel/register.h b/kernel/register.h
index 4dd86cf3..3165d2bf 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<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();
};