diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-12-29 05:10:19 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-12-29 05:11:06 +0100 |
commit | 3ff0d04555c4467a2d9bcd5e754d82ede5bf84dd (patch) | |
tree | c82246d6bf0c302848aa79c6cf38e20177475b94 | |
parent | 33e25394b447eda249cc9cf7c114093f3069fb62 (diff) | |
download | yosys-3ff0d04555c4467a2d9bcd5e754d82ede5bf84dd.tar.gz yosys-3ff0d04555c4467a2d9bcd5e754d82ede5bf84dd.tar.bz2 yosys-3ff0d04555c4467a2d9bcd5e754d82ede5bf84dd.zip |
Cleanups in opt_clean
-rw-r--r-- | passes/opt/opt_clean.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc index aabdbf013..c5b25816c 100644 --- a/passes/opt/opt_clean.cc +++ b/passes/opt/opt_clean.cc @@ -347,16 +347,16 @@ struct OptCleanPass : public Pass { ct_reg.setup_internals_mem(); ct_reg.setup_stdcells_mem(); - for (auto &mod_it : design->modules_) { - if (!design->selected_whole_module(mod_it.first)) { - if (design->selected(mod_it.second)) - log("Skipping module %s as it is only partially selected.\n", id2cstr(mod_it.second->name)); + for (auto mod : design->modules()) { + if (!design->selected_whole_module(mod->name)) { + if (design->selected(mod)) + log("Skipping module %s as it is only partially selected.\n", id2cstr(mod->name)); continue; } - if (mod_it.second->processes.size() > 0) { - log("Skipping module %s as it contains processes.\n", mod_it.second->name.c_str()); + if (!mod->processes.empty()) { + log("Skipping module %s as it contains processes.\n", mod->name.c_str()); } 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_wires = 0; - for (auto &mod_it : design->modules_) { - if (design->selected_whole_module(mod_it.first) && mod_it.second->processes.size() == 0) + for (auto mod : design->modules()) { + if (design->selected_whole_module(mod->name) && mod->processes.empty()) do { 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")); } |