mirror of https://github.com/YosysHQ/yosys.git
cutpoint: Improve efficiency by iterating over module ports instead of module wires.
This commit is contained in:
parent
dfde1cf1c5
commit
76dfa81790
|
@ -126,15 +126,16 @@ struct CutpointPass : public Pass {
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<Wire*> rewrite_wires;
|
vector<Wire*> rewrite_wires;
|
||||||
for (auto wire : module->wires()) {
|
for (auto id : module->ports) {
|
||||||
if (!wire->port_input)
|
RTLIL::Wire *wire = module->wire(id);
|
||||||
continue;
|
if (wire->port_input) {
|
||||||
int bit_count = 0;
|
int bit_count = 0;
|
||||||
for (auto &bit : sigmap(wire))
|
for (auto &bit : sigmap(wire))
|
||||||
if (cutpoint_bits.count(bit))
|
if (cutpoint_bits.count(bit))
|
||||||
bit_count++;
|
bit_count++;
|
||||||
if (bit_count)
|
if (bit_count)
|
||||||
rewrite_wires.push_back(wire);
|
rewrite_wires.push_back(wire);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto wire : rewrite_wires) {
|
for (auto wire : rewrite_wires) {
|
||||||
|
|
Loading…
Reference in New Issue