summaryrefslogtreecommitdiff
path: root/passes/cmds
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-02-04 23:23:44 +0100
committerClifford Wolf <clifford@clifford.at>2014-02-04 23:23:44 +0100
commitb1bf55dd63936cecab0320196236e50673f951f1 (patch)
tree3b2bf252734b690df1bc4fd1e3a688b8a4ce8d3b /passes/cmds
parente0c867db5349a00e0041a0a50a9ababdc3a170fe (diff)
Added select -none
Diffstat (limited to 'passes/cmds')
-rw-r--r--passes/cmds/select.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc
index 9c0a3965..253d8d68 100644
--- a/passes/cmds/select.cc
+++ b/passes/cmds/select.cc
@@ -709,8 +709,12 @@ struct SelectPass : public Pass {
log(" count all objects in the current selection\n");
log("\n");
log(" -clear\n");
- log(" clear the current selection. this effectively selects the\n");
- log(" whole design.\n");
+ log(" clear the current selection. this effectively selects the whole\n");
+ log(" design. it also resets the selected module (see -module). use the\n");
+ log(" command 'select *' to select everything but stay in the current module.\n");
+ log("\n");
+ log(" -none\n");
+ log(" create an empty selection. the current module is unchanged.\n");
log("\n");
log(" -module <modname>\n");
log(" limit the current scope to the specified module.\n");
@@ -825,6 +829,7 @@ struct SelectPass : public Pass {
bool add_mode = false;
bool del_mode = false;
bool clear_mode = false;
+ bool none_mode = false;
bool list_mode = false;
bool count_mode = false;
bool got_module = false;
@@ -859,6 +864,10 @@ struct SelectPass : public Pass {
clear_mode = true;
continue;
}
+ if (arg == "-none") {
+ none_mode = true;
+ continue;
+ }
if (arg == "-list") {
list_mode = true;
continue;
@@ -891,6 +900,9 @@ struct SelectPass : public Pass {
if (clear_mode && args.size() != 2)
log_cmd_error("Option -clear can not be combined with any other options.\n");
+ if (none_mode && args.size() != 2)
+ log_cmd_error("Option -none can not be combined with any other options.\n");
+
if (add_mode + del_mode + assert_none + assert_any > 1)
log_cmd_error("Options -add, -del, -assert-none or -assert-any can not be combined.\n");
@@ -913,13 +925,17 @@ struct SelectPass : public Pass {
assert(design->selection_stack.size() > 0);
- if (clear_mode)
- {
+ if (clear_mode) {
design->selection_stack.back() = RTLIL::Selection(true);
design->selected_active_module = std::string();
return;
}
+ if (none_mode) {
+ design->selection_stack.back() = RTLIL::Selection(false);
+ return;
+ }
+
if (list_mode || count_mode || !write_file.empty())
{
#define LOG_OBJECT(...) do { if (list_mode) log(__VA_ARGS__); if (f != NULL) fprintf(f, __VA_ARGS__); total_count++; } while (0)