mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 22:23:23 +00:00
Merge 19cdbc5a0c
into 50b63c6481
This commit is contained in:
commit
3db3f4d0da
1 changed files with 4 additions and 1 deletions
|
@ -737,6 +737,7 @@ struct OptDffWorker
|
||||||
bool run_constbits() {
|
bool run_constbits() {
|
||||||
ModWalker modwalker(module->design, module);
|
ModWalker modwalker(module->design, module);
|
||||||
QuickConeSat qcsat(modwalker);
|
QuickConeSat qcsat(modwalker);
|
||||||
|
std::vector<RTLIL::Cell*> cells_to_remove;
|
||||||
|
|
||||||
// Run as a separate sub-pass, so that we don't mutate (non-FF) cells under ModWalker.
|
// Run as a separate sub-pass, so that we don't mutate (non-FF) cells under ModWalker.
|
||||||
bool did_something = false;
|
bool did_something = false;
|
||||||
|
@ -830,7 +831,7 @@ struct OptDffWorker
|
||||||
if (!removed_sigbits.count(i))
|
if (!removed_sigbits.count(i))
|
||||||
keep_bits.push_back(i);
|
keep_bits.push_back(i);
|
||||||
if (keep_bits.empty()) {
|
if (keep_bits.empty()) {
|
||||||
module->remove(cell);
|
cells_to_remove.emplace_back(cell);
|
||||||
did_something = true;
|
did_something = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -840,6 +841,8 @@ struct OptDffWorker
|
||||||
did_something = true;
|
did_something = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto* cell : cells_to_remove)
|
||||||
|
module->remove(cell);
|
||||||
return did_something;
|
return did_something;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue