Skip to content

Commit a84fa0a

Browse files
committed
connect: Do interpret selection arguments
Instead of silently ignoring what would ordinarily be the selection arguments to a pass, interpret those and mark the support in the help message.
1 parent bbb8ad5 commit a84fa0a

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

passes/cmds/connect.cc

+15-14
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ struct ConnectPass : public Pass {
4747
{
4848
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
4949
log("\n");
50-
log(" connect [-nomap] [-nounset] -set <lhs-expr> <rhs-expr>\n");
50+
log(" connect [-nomap] [-nounset] -set <lhs-expr> <rhs-expr> [selection]\n");
5151
log("\n");
5252
log("Create a connection. This is equivalent to adding the statement 'assign\n");
5353
log("<lhs-expr> = <rhs-expr>;' to the Verilog input. Per default, all existing\n");
5454
log("drivers for <lhs-expr> are unconnected. This can be overwritten by using\n");
5555
log("the -nounset option.\n");
5656
log("\n");
5757
log("\n");
58-
log(" connect [-nomap] -unset <expr>\n");
58+
log(" connect [-nomap] -unset <expr> [selection]\n");
5959
log("\n");
6060
log("Unconnect all existing drivers for the specified expression.\n");
6161
log("\n");
6262
log("\n");
63-
log(" connect [-nomap] [-assert] -port <cell> <port> <expr>\n");
63+
log(" connect [-nomap] [-assert] -port <cell> <port> <expr> [selection]\n");
6464
log("\n");
6565
log("Connect the specified cell port to the specified cell port.\n");
6666
log("\n");
@@ -80,17 +80,6 @@ struct ConnectPass : public Pass {
8080
}
8181
void execute(std::vector<std::string> args, RTLIL::Design *design) override
8282
{
83-
RTLIL::Module *module = nullptr;
84-
for (auto mod : design->selected_modules()) {
85-
if (module != nullptr)
86-
log_cmd_error("Multiple modules selected: %s, %s\n", log_id(module->name), log_id(mod->name));
87-
module = mod;
88-
}
89-
if (module == nullptr)
90-
log_cmd_error("No modules selected.\n");
91-
if (!module->processes.empty())
92-
log_cmd_error("Found processes in selected module.\n");
93-
9483
bool flag_nounset = false, flag_nomap = false, flag_assert = false;
9584
std::string set_lhs, set_rhs, unset_expr;
9685
std::string port_cell, port_port, port_expr;
@@ -128,6 +117,18 @@ struct ConnectPass : public Pass {
128117
}
129118
break;
130119
}
120+
extra_args(args, argidx, design);
121+
122+
RTLIL::Module *module = nullptr;
123+
for (auto mod : design->selected_modules()) {
124+
if (module != nullptr)
125+
log_cmd_error("Multiple modules selected: %s, %s\n", log_id(module->name), log_id(mod->name));
126+
module = mod;
127+
}
128+
if (module == nullptr)
129+
log_cmd_error("No modules selected.\n");
130+
if (!module->processes.empty())
131+
log_cmd_error("Found processes in selected module.\n");
131132

132133
SigMap sigmap;
133134
if (!flag_nomap)

0 commit comments

Comments
 (0)