aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlberto Gonzalez <boqwxp@airmail.cc>2020-03-23 06:31:41 +0000
committerAlberto Gonzalez <boqwxp@airmail.cc>2020-03-23 17:30:53 +0000
commitca4e5dd56e1f007fa13c791ab179236103187c6f (patch)
tree8aa2a9a40112a1d593220b4ad9d309fa7587e9fc
parent1b333d49ef0144d6f440b1c6cc57a6a6e2d4a1de (diff)
downloadyosys-ca4e5dd56e1f007fa13c791ab179236103187c6f.tar.gz
yosys-ca4e5dd56e1f007fa13c791ab179236103187c6f.tar.bz2
yosys-ca4e5dd56e1f007fa13c791ab179236103187c6f.zip
Suppress warnings for empty `select` arguments when `-count` or `-assert-*` options are set.
-rw-r--r--passes/cmds/select.cc9
-rw-r--r--tests/select/no_warn_assert.ys2
2 files changed, 7 insertions, 4 deletions
diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc
index 42938b6ba..fc693d20e 100644
--- a/passes/cmds/select.cc
+++ b/passes/cmds/select.cc
@@ -625,7 +625,7 @@ static void select_filter_active_mod(RTLIL::Design *design, RTLIL::Selection &se
}
}
-static void select_stmt(RTLIL::Design *design, std::string arg)
+static void select_stmt(RTLIL::Design *design, std::string arg, bool disable_empty_warning = false)
{
std::string arg_mod, arg_memb;
std::unordered_map<std::string, bool> arg_mod_found;
@@ -913,12 +913,12 @@ static void select_stmt(RTLIL::Design *design, std::string arg)
select_filter_active_mod(design, work_stack.back());
for (auto &it : arg_mod_found) {
- if (it.second == false) {
+ if (it.second == false && !disable_empty_warning) {
log_warning("Selection \"%s\" did not match any module.\n", it.first.c_str());
}
}
for (auto &it : arg_memb_found) {
- if (it.second == false) {
+ if (it.second == false && !disable_empty_warning) {
log_warning("Selection \"%s\" did not match any object.\n", it.first.c_str());
}
}
@@ -1311,7 +1311,8 @@ struct SelectPass : public Pass {
}
if (arg.size() > 0 && arg[0] == '-')
log_cmd_error("Unknown option %s.\n", arg.c_str());
- select_stmt(design, arg);
+ bool disable_empty_warning = count_mode || assert_none || assert_any || (assert_count != -1) || (assert_max != -1) || (assert_min != -1);
+ select_stmt(design, arg, disable_empty_warning);
sel_str += " " + arg;
}
diff --git a/tests/select/no_warn_assert.ys b/tests/select/no_warn_assert.ys
new file mode 100644
index 000000000..889315826
--- /dev/null
+++ b/tests/select/no_warn_assert.ys
@@ -0,0 +1,2 @@
+logger -expect-no-warnings
+select -assert-count 0 top/t:ff4 top/w:d0 %co:+[d] %i