3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-05 02:40:25 +00:00

Proc: Use selections consistently

All `proc_*` passes now use the same module and process for loops, using `design->all_selected_modules()` and `mod->selected_processes()` respectively.
This simplifies the code, and makes the couple `proc_*` passes that were ignoring boxed modules stop doing that (which seems to have been erroneous rather than intentional).
This commit is contained in:
Krystine Sherwin 2025-05-31 12:04:42 +12:00
parent 545753cc5a
commit ab0e3cc05f
No known key found for this signature in database
10 changed files with 69 additions and 98 deletions

View file

@ -147,21 +147,17 @@ struct ProcRmdeadPass : public Pass {
extra_args(args, 1, design);
int total_counter = 0;
for (auto mod : design->modules()) {
if (!design->selected(mod))
continue;
for (auto &proc_it : mod->processes) {
if (!design->selected(mod, proc_it.second))
continue;
for (auto mod : design->all_selected_modules()) {
for (auto proc : mod->selected_processes()) {
int counter = 0, full_case_counter = 0;
for (auto switch_it : proc_it.second->root_case.switches)
for (auto switch_it : proc->root_case.switches)
proc_rmdead(switch_it, counter, full_case_counter);
if (counter > 0)
log("Removed %d dead cases from process %s in module %s.\n", counter,
log_id(proc_it.first), log_id(mod));
log_id(proc), log_id(mod));
if (full_case_counter > 0)
log("Marked %d switch rules as full_case in process %s in module %s.\n",
full_case_counter, log_id(proc_it.first), log_id(mod));
full_case_counter, log_id(proc), log_id(mod));
total_counter += counter;
}
}