summaryrefslogtreecommitdiff
path: root/passes/cmds/select.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-02-05 18:52:55 +0100
committerClifford Wolf <clifford@clifford.at>2014-02-05 18:52:55 +0100
commitdbfcc2f4e249810ed6b562c8b6171a39caac141d (patch)
tree2b48e65b4820abe7a5e3137b3fd03e73adf38261 /passes/cmds/select.cc
parent94b802c65dd2456cf81fc6c871763d992a7639b3 (diff)
Simplified select "Assertation failed" message generation
Diffstat (limited to 'passes/cmds/select.cc')
-rw-r--r--passes/cmds/select.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc
index e4e12b84..ab7da50b 100644
--- a/passes/cmds/select.cc
+++ b/passes/cmds/select.cc
@@ -705,20 +705,6 @@ void handle_extra_select_args(Pass *pass, std::vector<std::string> args, size_t
design->selection_stack.push_back(RTLIL::Selection(false));
}
-std::string list_nonopt_args(std::vector<std::string> args)
-{
- size_t argidx;
- std::string result = "";
- for (argidx = 1; argidx < args.size(); argidx++)
- {
- std::string arg = args[argidx];
- if (arg.size() > 0 && arg[0] == '-')
- continue;
- result += arg + " ";
- }
- return result;
-}
-
struct SelectPass : public Pass {
SelectPass() : Pass("select", "modify and view the list of selected objects") { }
virtual void help()
@@ -901,6 +887,7 @@ struct SelectPass : public Pass {
bool assert_any = false;
std::string write_file;
std::string set_name;
+ std::string sel_str;
work_stack.clear();
@@ -959,6 +946,7 @@ struct SelectPass : public Pass {
if (arg.size() > 0 && arg[0] == '-')
log_cmd_error("Unkown option %s.\n", arg.c_str());
select_stmt(design, arg);
+ sel_str += " " + arg;
}
if (clear_mode && args.size() != 2)
@@ -1064,7 +1052,7 @@ struct SelectPass : public Pass {
if (work_stack.size() == 0)
log_cmd_error("No selection to check.\n");
if (!work_stack.back().empty())
- log_error("Assertation failed: selection is not empty: %s\n",list_nonopt_args(args).c_str());
+ log_error("Assertation failed: selection is not empty:%s\n", sel_str.c_str());
return;
}
@@ -1073,7 +1061,7 @@ struct SelectPass : public Pass {
if (work_stack.size() == 0)
log_cmd_error("No selection to check.\n");
if (work_stack.back().empty())
- log_error("Assertation failed: selection is empty: %s\n",list_nonopt_args(args).c_str());
+ log_error("Assertation failed: selection is empty:%s\n", sel_str.c_str());
return;
}