diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-01-06 12:36:11 -0800 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-01-07 15:46:36 -0800 |
commit | 102f1397284980705efe3eb03cc3d3cd859e94ff (patch) | |
tree | 01cee2d58787ac91f32b3f274caeb4624b93c121 /passes | |
parent | 66b0f3c406fca11d789b26d85dd27660eacee26c (diff) | |
download | yosys-102f1397284980705efe3eb03cc3d3cd859e94ff.tar.gz yosys-102f1397284980705efe3eb03cc3d3cd859e94ff.tar.bz2 yosys-102f1397284980705efe3eb03cc3d3cd859e94ff.zip |
scc to use design->selected_modules() which avoids black/white-boxes
Diffstat (limited to 'passes')
-rw-r--r-- | passes/cmds/scc.cc | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/passes/cmds/scc.cc b/passes/cmds/scc.cc index 99f4fbae8..ad0554bae 100644 --- a/passes/cmds/scc.cc +++ b/passes/cmds/scc.cc @@ -301,42 +301,41 @@ struct SccPass : public Pass { RTLIL::Selection newSelection(false); int scc_counter = 0; - for (auto &mod_it : design->modules_) - if (design->selected(mod_it.second)) - { - SccWorker worker(design, mod_it.second, nofeedbackMode, allCellTypes, maxDepth); + for (auto mod : design->selected_modules()) + { + SccWorker worker(design, mod, nofeedbackMode, allCellTypes, maxDepth); - if (!setAttr.empty()) + if (!setAttr.empty()) + { + for (const auto &cells : worker.sccList) { - for (const auto &cells : worker.sccList) + for (auto attr : setAttr) { - for (auto attr : setAttr) - { - IdString attr_name(RTLIL::escape_id(attr.first)); - string attr_valstr = attr.second; - string index = stringf("%d", scc_counter); - - for (size_t pos = 0; (pos = attr_valstr.find("{}", pos)) != string::npos; pos += index.size()) - attr_valstr.replace(pos, 2, index); + IdString attr_name(RTLIL::escape_id(attr.first)); + string attr_valstr = attr.second; + string index = stringf("%d", scc_counter); - Const attr_value(attr_valstr); + for (size_t pos = 0; (pos = attr_valstr.find("{}", pos)) != string::npos; pos += index.size()) + attr_valstr.replace(pos, 2, index); - for (auto cell : cells) - cell->attributes[attr_name] = attr_value; - } + Const attr_value(attr_valstr); - scc_counter++; + for (auto cell : cells) + cell->attributes[attr_name] = attr_value; } - } - else - { - scc_counter += GetSize(worker.sccList); - } - if (selectMode) - worker.select(newSelection); + scc_counter++; + } + } + else + { + scc_counter += GetSize(worker.sccList); } + if (selectMode) + worker.select(newSelection); + } + if (expect >= 0) { if (scc_counter == expect) log("Found and expected %d SCCs.\n", scc_counter); |