diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-03-19 10:05:01 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-03-19 10:05:01 +0100 |
commit | 9a34486bfbc8780d9a3af3164e99977e44d2a65f (patch) | |
tree | 84843b437ac3936f9c2ccbae3018b6655b257f04 /passes/opt | |
parent | cdf12575651da53bff456617be2c5d1f825ba7fc (diff) | |
download | yosys-9a34486bfbc8780d9a3af3164e99977e44d2a65f.tar.gz yosys-9a34486bfbc8780d9a3af3164e99977e44d2a65f.tar.bz2 yosys-9a34486bfbc8780d9a3af3164e99977e44d2a65f.zip |
Fixed performance problem in opt_mux with nets driven by many conflicting drivers
Diffstat (limited to 'passes/opt')
-rw-r--r-- | passes/opt/opt_muxtree.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/passes/opt/opt_muxtree.cc b/passes/opt/opt_muxtree.cc index 47100869c..3292a46c8 100644 --- a/passes/opt/opt_muxtree.cc +++ b/passes/opt/opt_muxtree.cc @@ -309,13 +309,17 @@ struct OptMuxtreeWorker if (port_idx < int(muxinfo.ports.size())-1 && !muxinfo.ports[port_idx].const_activated) knowledge.known_active.push_back(muxinfo.ports[port_idx].ctrl_sigs); + std::vector<int> parent_muxes; for (int m : muxinfo.ports[port_idx].input_muxes) { if (knowledge.visited_muxes.count(m) > 0) continue; knowledge.visited_muxes.insert(m); + parent_muxes.push_back(m); + } + for (int m : parent_muxes) eval_mux(knowledge, m); + for (int m : parent_muxes) knowledge.visited_muxes.erase(m); - } if (port_idx < int(muxinfo.ports.size())-1 && !muxinfo.ports[port_idx].const_activated) knowledge.known_active.pop_back(); @@ -393,6 +397,7 @@ struct OptMuxtreeWorker void eval_root_mux(int mux_idx) { knowledge_t knowledge; + knowledge.visited_muxes.insert(mux_idx); eval_mux(knowledge, mux_idx); } }; |