be more verbose for select -assert-any and -assert-none
authorJohann Glaser <Johann.Glaser@gmx.at>
Wed, 5 Feb 2014 15:03:02 +0000 (16:03 +0100)
committerJohann Glaser <Johann.Glaser@gmx.at>
Wed, 5 Feb 2014 15:03:02 +0000 (16:03 +0100)
passes/cmds/select.cc

index bdfa7a64eb8094b1fdac83ae6fc6108df4ad91bd..963b6940fa6b75837ee606d3da0a5046f3efd8b3 100644 (file)
@@ -664,6 +664,20 @@ 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()
@@ -1004,7 +1018,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.\n");
+                               log_error("Assertation failed: selection is not empty: %s\n",list_nonopt_args(args).c_str());
                        return;
                }
 
@@ -1013,7 +1027,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.\n");
+                               log_error("Assertation failed: selection is empty: %s\n",list_nonopt_args(args).c_str());
                        return;
                }