Clean up `passes/cmds/scatter.cc`.

This commit is contained in:
Alberto Gonzalez 2020-04-09 05:34:28 +00:00
parent 8d3f6d0d79
commit 0787af947f
No known key found for this signature in database
GPG Key ID: 8395A8BA109708B2
1 changed files with 7 additions and 10 deletions

View File

@ -46,22 +46,19 @@ struct ScatterPass : public Pass {
CellTypes ct(design); CellTypes ct(design);
extra_args(args, 1, design); extra_args(args, 1, design);
for (auto &mod_it : design->modules_) for (auto module : design->selected_modules())
{ {
if (!design->selected(mod_it.second)) for (auto cell : module->cells())
continue; for (auto &p : cell->connections_)
for (auto &c : mod_it.second->cells_)
for (auto &p : c.second->connections_)
{ {
RTLIL::Wire *wire = mod_it.second->addWire(NEW_ID, p.second.size()); RTLIL::Wire *wire = module->addWire(NEW_ID, p.second.size());
if (ct.cell_output(c.second->type, p.first)) { if (ct.cell_output(cell->type, p.first)) {
RTLIL::SigSig sigsig(p.second, wire); RTLIL::SigSig sigsig(p.second, wire);
mod_it.second->connect(sigsig); module->connect(sigsig);
} else { } else {
RTLIL::SigSig sigsig(wire, p.second); RTLIL::SigSig sigsig(wire, p.second);
mod_it.second->connect(sigsig); module->connect(sigsig);
} }
p.second = wire; p.second = wire;