mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-25 00:22:34 +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.analyze_loops = false;
|
||||||
unified_toposort.sort();
|
unified_toposort.sort();
|
||||||
|
|
||||||
// Process cells and wires together in unified topological order
|
// Process cells and wires together in unified topological order (both forwards and backwards)
|
||||||
for (auto name : unified_toposort.sorted) {
|
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);
|
Cell *c = module->cell(name);
|
||||||
Wire *w = module->wire(name);
|
Wire *w = module->wire(name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ prep
|
||||||
design -save gold
|
design -save gold
|
||||||
alumacc
|
alumacc
|
||||||
opt_clean
|
opt_clean
|
||||||
select -assert-count 2 t:$macc_v2
|
select -assert-count 1 t:$macc_v2
|
||||||
maccmap -unmap
|
maccmap -unmap
|
||||||
design -copy-from gold -as gold gate
|
design -copy-from gold -as gold gate
|
||||||
equiv_make gold gate equiv
|
equiv_make gold gate equiv
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue