mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-18 21:25:47 +00:00
Run toposort in both directions for better results
This commit is contained in:
parent
2d5c16b798
commit
41dfe4fc61
2 changed files with 6 additions and 3 deletions
|
|
@ -524,8 +524,11 @@ struct WreduceWorker
|
|||
unified_toposort.analyze_loops = false;
|
||||
unified_toposort.sort();
|
||||
|
||||
// Process cells and wires together in unified topological order
|
||||
for (auto name : unified_toposort.sorted) {
|
||||
// Process cells and wires together in unified topological order (both forwards and backwards)
|
||||
std::vector<IdString> sorted_cells_and_wires_both_ways;
|
||||
sorted_cells_and_wires_both_ways.insert(sorted_cells_and_wires_both_ways.end(), unified_toposort.sorted.begin(), unified_toposort.sorted.end());
|
||||
sorted_cells_and_wires_both_ways.insert(sorted_cells_and_wires_both_ways.end(), unified_toposort.sorted.rbegin(), unified_toposort.sorted.rend());
|
||||
for (auto name : sorted_cells_and_wires_both_ways) {
|
||||
Cell *c = module->cell(name);
|
||||
Wire *w = module->wire(name);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue