mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-19 13:45:48 +00:00
patch: infer leaves for gc
This commit is contained in:
parent
1cd0d37511
commit
cef8186c4a
4 changed files with 18 additions and 8 deletions
|
|
@ -156,6 +156,18 @@ void Patch::patch(Cell* old_cell, IdString old_port, SigSpec new_sig) {
|
|||
if (map)
|
||||
map->add(old_sig, new_sig);
|
||||
|
||||
// Inefficient
|
||||
for (auto& cell : cells_) {
|
||||
for (auto& [port_name, sig] : cell->connections()) {
|
||||
auto dir = cell->port_dir(port_name);
|
||||
if (dir == PD_INPUT || dir == PD_INOUT) {
|
||||
for (auto bit : sig)
|
||||
if (bit.is_wire() && bit.wire->module)
|
||||
leaves.insert(bit.wire);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& cell: cells_) {
|
||||
cell->set_src_attribute(src_str);
|
||||
cell->fixup_parameters();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue