3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 18:05:24 +00:00

Apply opt_reduce WR_EN opts to the whole mux tree driving the WR_EN port

This commit is contained in:
Clifford Wolf 2014-07-18 10:28:45 +02:00
parent 2d69c309f9
commit 309ae98246

View file

@ -266,6 +266,21 @@ struct OptReduceWorker
mem_wren_sigs.add(assign_map(cell->connections["\\D"])); mem_wren_sigs.add(assign_map(cell->connections["\\D"]));
} }
bool keep_expanding_mem_wren_sigs = true;
while (keep_expanding_mem_wren_sigs) {
keep_expanding_mem_wren_sigs = false;
for (auto &cell_it : module->cells) {
RTLIL::Cell *cell = cell_it.second;
if (cell->type == "$mux" && mem_wren_sigs.check_any(assign_map(cell->connections["\\Y"]))) {
if (!mem_wren_sigs.check_all(assign_map(cell->connections["\\A"])) ||
!mem_wren_sigs.check_all(assign_map(cell->connections["\\B"])))
keep_expanding_mem_wren_sigs = true;
mem_wren_sigs.add(assign_map(cell->connections["\\A"]));
mem_wren_sigs.add(assign_map(cell->connections["\\B"]));
}
}
}
while (did_something) while (did_something)
{ {
did_something = false; did_something = false;