Do not warn on empty selection with prefixed `arg_memb`.
authorAlberto Gonzalez <boqwxp@airmail.cc>
Mon, 23 Mar 2020 17:50:11 +0000 (17:50 +0000)
committerAlberto Gonzalez <boqwxp@airmail.cc>
Mon, 23 Mar 2020 17:50:11 +0000 (17:50 +0000)
Co-Authored-By: N. Engelhardt <nak@symbioticeda.com>
passes/cmds/select.cc
tests/select/no_warn_prefixed_arg_memb.ys [new file with mode: 0644]

index fc693d20ecc2f7e8689a6e4f1bc855a256e3a37e..b64b077e4ca191633874444610e09374d71cc32a 100644 (file)
@@ -775,7 +775,8 @@ static void select_stmt(RTLIL::Design *design, std::string arg, bool disable_emp
                        arg_mod = arg.substr(0, pos);
                        if (!prefixed) arg_mod_found[arg_mod] = false;
                        arg_memb = arg.substr(pos+1);
-                       if (!prefixed) arg_memb_found[arg_memb] = false;
+                       bool arg_memb_prefixed = GetSize(arg_memb) >= 2 && isalpha(arg_memb[0]) && arg_memb[1] == ':';
+                       if (!arg_memb_prefixed) arg_memb_found[arg_memb] = false;
                }
        }
 
diff --git a/tests/select/no_warn_prefixed_arg_memb.ys b/tests/select/no_warn_prefixed_arg_memb.ys
new file mode 100644 (file)
index 0000000..596a6ed
--- /dev/null
@@ -0,0 +1,5 @@
+logger -expect-no-warnings
+read_verilog ../../examples/igloo2/example.v
+hierarchy
+proc
+select example/t:$add