aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-05-12 15:33:53 +0200
committerGitHub <noreply@github.com>2019-05-12 15:33:53 +0200
commit5772732a6d24bbf1a46301f03623567079316f7a (patch)
treeeb52845c2e879ba58d0a888fc5fc2011eef8ef25 /passes
parentfaf00586d811479f486771102ba1a399e6a0f2df (diff)
parent8166a142dd251f9d9ba2d172737d757ac52aa772 (diff)
downloadyosys-5772732a6d24bbf1a46301f03623567079316f7a.tar.gz
yosys-5772732a6d24bbf1a46301f03623567079316f7a.tar.bz2
yosys-5772732a6d24bbf1a46301f03623567079316f7a.zip
Merge pull request #1004 from YosysHQ/clifford/fix1002
Fix handling of glob_abort_cnt in opt_muxtree
Diffstat (limited to 'passes')
-rw-r--r--passes/opt/opt_muxtree.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/passes/opt/opt_muxtree.cc b/passes/opt/opt_muxtree.cc
index dbebf21e0..6511e091b 100644
--- a/passes/opt/opt_muxtree.cc
+++ b/passes/opt/opt_muxtree.cc
@@ -184,6 +184,10 @@ struct OptMuxtreeWorker
log_debug(" Root of a mux tree: %s%s\n", log_id(mux2info[mux_idx].cell), root_enable_muxes.at(mux_idx) ? " (pure)" : "");
root_mux_rerun.erase(mux_idx);
eval_root_mux(mux_idx);
+ if (glob_abort_cnt == 0) {
+ log(" Giving up (too many iterations)\n");
+ return;
+ }
}
while (!root_mux_rerun.empty()) {
@@ -192,9 +196,14 @@ struct OptMuxtreeWorker
log_assert(root_enable_muxes.at(mux_idx));
root_mux_rerun.erase(mux_idx);
eval_root_mux(mux_idx);
+ if (glob_abort_cnt == 0) {
+ log(" Giving up (too many iterations)\n");
+ return;
+ }
}
log(" Analyzing evaluation results.\n");
+ log_assert(glob_abort_cnt > 0);
for (auto &mi : mux2info)
{
@@ -397,10 +406,8 @@ struct OptMuxtreeWorker
void eval_mux(knowledge_t &knowledge, int mux_idx, bool do_replace_known, bool do_enable_ports, int abort_count)
{
- if (glob_abort_cnt == 0) {
- log(" Giving up (too many iterations)\n");
+ if (glob_abort_cnt == 0)
return;
- }
glob_abort_cnt--;
muxinfo_t &muxinfo = mux2info[mux_idx];
@@ -454,6 +461,7 @@ struct OptMuxtreeWorker
void eval_root_mux(int mux_idx)
{
+ log_assert(glob_abort_cnt > 0);
knowledge_t knowledge;
knowledge.known_inactive.resize(GetSize(bit2info));
knowledge.known_active.resize(GetSize(bit2info));