3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-06 19:21:23 +00:00

Warn on empty selection for add command.

This commit is contained in:
Alberto Gonzalez 2020-03-12 17:00:21 +00:00
parent 7f5c73d58f
commit 5026f36250
No known key found for this signature in database
GPG key ID: 8395A8BA109708B2
2 changed files with 40 additions and 6 deletions

View file

@ -206,6 +206,7 @@ struct AddPass : public Pass {
extra_args(args, argidx, design);
bool selected_anything = false;
for (auto module : design->modules())
{
log_assert(module != nullptr);
@ -214,11 +215,14 @@ struct AddPass : public Pass {
if (module->get_bool_attribute("\\blackbox"))
continue;
selected_anything = true;
if (is_formal_celltype(command))
add_formal(module, command, arg_name, enable_name);
else if (command == "wire")
add_wire(design, module, arg_name, arg_width, arg_flag_input, arg_flag_output, arg_flag_global);
}
if (!selected_anything)
log_warning("No modules selected, or only blackboxes. Nothing was added.\n");
}
} AddPass;