From: Claire Wolf Date: Tue, 17 Mar 2020 17:44:06 +0000 (+0100) Subject: Add N:* to select language, fix some old code X-Git-Tag: working-ls180~730^2~4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f5c73d58fd732a96e480083896cd73c722849ba;p=yosys.git Add N:* to select language, fix some old code Signed-off-by: Claire Wolf --- diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc index 1657ef818..4dcf76480 100644 --- a/passes/cmds/select.cc +++ b/passes/cmds/select.cc @@ -764,10 +764,7 @@ static void select_stmt(RTLIL::Design *design, std::string arg) } else { size_t pos = arg.find('/'); if (pos == std::string::npos) { - if (arg.find(':') == std::string::npos || arg.compare(0, 1, "A") == 0) - arg_mod = arg; - else - arg_mod = "*", arg_memb = arg; + arg_mod = arg; } else { arg_mod = arg.substr(0, pos); arg_memb = arg.substr(pos+1); @@ -789,6 +786,10 @@ static void select_stmt(RTLIL::Design *design, std::string arg) if (!match_attr(mod->attributes, arg_mod.substr(2))) continue; } else + if (arg_mod.compare(0, 2, "N:") == 0) { + if (!match_ids(mod->name, arg_mod.substr(2))) + continue; + } else if (!match_ids(mod->name, arg_mod)) continue; @@ -1074,6 +1075,10 @@ struct SelectPass : public Pass { log(" all modules with an attribute matching the given pattern\n"); log(" in addition to = also <, <=, >=, and > are supported\n"); log("\n"); + log(" N:\n"); + log(" all modules with a name matching the given pattern\n"); + log(" (i.e. 'N:' is optional as it is the default matching rule)\n"); + log("\n"); log("An can be an object name, wildcard expression, or one of\n"); log("the following:\n"); log("\n");