mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 20:38:44 +00:00
cutpoint: Improve efficiency by iterating over module ports instead of module wires.
This commit is contained in:
parent
dfde1cf1c5
commit
76dfa81790
|
@ -126,9 +126,9 @@ struct CutpointPass : public Pass {
|
|||
}
|
||||
|
||||
vector<Wire*> rewrite_wires;
|
||||
for (auto wire : module->wires()) {
|
||||
if (!wire->port_input)
|
||||
continue;
|
||||
for (auto id : module->ports) {
|
||||
RTLIL::Wire *wire = module->wire(id);
|
||||
if (wire->port_input) {
|
||||
int bit_count = 0;
|
||||
for (auto &bit : sigmap(wire))
|
||||
if (cutpoint_bits.count(bit))
|
||||
|
@ -136,6 +136,7 @@ struct CutpointPass : public Pass {
|
|||
if (bit_count)
|
||||
rewrite_wires.push_back(wire);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto wire : rewrite_wires) {
|
||||
Wire *new_wire = module->addWire(NEW_ID, wire);
|
||||
|
|
Loading…
Reference in a new issue