mirror of
https://github.com/YosysHQ/yosys
synced 2026-03-19 19:43:15 +00:00
setundef: respect selection for cells, processes, and connections
Previously, setundef would rewrite sigspecs in all cells, processes, and connections regardless of the active selection. Only modules and memories were correctly filtered by selection. Fix by using module->selected_cells() for cells, adding a module->selected() check for processes, and checking wire selection on the lhs of each connection before rewriting. Fixes #5624
This commit is contained in:
parent
0d7a875675
commit
94c789e9c8
1 changed files with 14 additions and 6 deletions
|
|
@ -502,14 +502,22 @@ struct SetundefPass : public Pass {
|
|||
}
|
||||
}
|
||||
|
||||
for (auto &it : module->cells_)
|
||||
if (!it.second->get_bool_attribute(ID::xprop_decoder))
|
||||
it.second->rewrite_sigspecs(worker);
|
||||
for (auto cell : module->selected_cells())
|
||||
if (!cell->get_bool_attribute(ID::xprop_decoder))
|
||||
cell->rewrite_sigspecs(worker);
|
||||
for (auto &it : module->processes)
|
||||
it.second->rewrite_sigspecs(worker);
|
||||
if (module->selected(it.second))
|
||||
it.second->rewrite_sigspecs(worker);
|
||||
for (auto &it : module->connections_) {
|
||||
worker(it.first);
|
||||
worker(it.second);
|
||||
SigSpec lhs = it.first;
|
||||
bool selected = false;
|
||||
for (auto &chunk : lhs.chunks())
|
||||
if (chunk.wire && module->design->selected(module, chunk.wire))
|
||||
selected = true;
|
||||
if (selected) {
|
||||
worker(it.first);
|
||||
worker(it.second);
|
||||
}
|
||||
}
|
||||
|
||||
if (worker.next_bit_mode == MODE_ANYSEQ || worker.next_bit_mode == MODE_ANYCONST)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue