Cleanups in opt_clean

This commit is contained in:
Clifford Wolf 2014-12-29 05:10:19 +01:00
parent 33e25394b4
commit 3ff0d04555
1 changed files with 10 additions and 10 deletions

View File

@ -347,16 +347,16 @@ struct OptCleanPass : public Pass {
ct_reg.setup_internals_mem(); ct_reg.setup_internals_mem();
ct_reg.setup_stdcells_mem(); ct_reg.setup_stdcells_mem();
for (auto &mod_it : design->modules_) { for (auto mod : design->modules()) {
if (!design->selected_whole_module(mod_it.first)) { if (!design->selected_whole_module(mod->name)) {
if (design->selected(mod_it.second)) if (design->selected(mod))
log("Skipping module %s as it is only partially selected.\n", id2cstr(mod_it.second->name)); log("Skipping module %s as it is only partially selected.\n", id2cstr(mod->name));
continue; continue;
} }
if (mod_it.second->processes.size() > 0) { if (!mod->processes.empty()) {
log("Skipping module %s as it contains processes.\n", mod_it.second->name.c_str()); log("Skipping module %s as it contains processes.\n", mod->name.c_str());
} else { } else {
rmunused_module(mod_it.second, purge_mode, true); rmunused_module(mod, purge_mode, true);
} }
} }
@ -411,11 +411,11 @@ struct CleanPass : public Pass {
count_rm_cells = 0; count_rm_cells = 0;
count_rm_wires = 0; count_rm_wires = 0;
for (auto &mod_it : design->modules_) { for (auto mod : design->modules()) {
if (design->selected_whole_module(mod_it.first) && mod_it.second->processes.size() == 0) if (design->selected_whole_module(mod->name) && mod->processes.empty())
do { do {
design->scratchpad_unset("opt.did_something"); design->scratchpad_unset("opt.did_something");
rmunused_module(mod_it.second, purge_mode, false); rmunused_module(mod, purge_mode, false);
} while (design->scratchpad_get_bool("opt.did_something")); } while (design->scratchpad_get_bool("opt.did_something"));
} }