1
0
mirror of synced 2026-02-05 16:24:43 +00:00

Merge pull request #999 from jakobwenzel/setundefInitFix

initialize more registers in setundef -init
This commit is contained in:
Clifford Wolf
2019-06-05 09:50:15 +02:00
committed by GitHub

View File

@@ -404,22 +404,29 @@ struct SetundefPass : public Pass {
initwires.insert(wire);
}
for (int wire_types = 0; wire_types < 2; wire_types++)
for (auto wire : module->wires())
{
if (wire->name[0] == (wire_types ? '\\' : '$'))
next_wire:
continue;
for (int wire_types = 0; wire_types < 2; wire_types++) {
pool<SigBit> ffbitsToErase;
for (auto wire : module->wires()) {
if (wire->name[0] == (wire_types ? '\\' : '$')) {
next_wire:
continue;
}
for (auto bit : sigmap(wire))
if (!ffbits.count(bit))
goto next_wire;
for (auto bit : sigmap(wire))
if (!ffbits.count(bit)) {
goto next_wire;
}
for (auto bit : sigmap(wire))
ffbits.erase(bit);
for (auto bit : sigmap(wire)) {
ffbitsToErase.insert(bit);
}
initwires.insert(wire);
}
initwires.insert(wire);
}
for (const auto &bit : ffbitsToErase) {
ffbits.erase(bit);
}
}
for (auto wire : initwires)
{