From 551d36d384c587d3cee667d44255a055afcdc30e Mon Sep 17 00:00:00 2001 From: Carlo Alberto Ferraris Date: Thu, 3 Nov 2022 21:18:21 +0900 Subject: [PATCH 1/3] opt_muxtree: set iterations limit based on number of muxes --- passes/opt/opt_muxtree.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/passes/opt/opt_muxtree.cc b/passes/opt/opt_muxtree.cc index 100b1b495..fc71dc8c5 100644 --- a/passes/opt/opt_muxtree.cc +++ b/passes/opt/opt_muxtree.cc @@ -36,7 +36,7 @@ struct OptMuxtreeWorker RTLIL::Module *module; SigMap assign_map; int removed_count; - int glob_abort_cnt = 100000; + int glob_abort_cnt; struct bitinfo_t { bool seen_non_mux; @@ -146,6 +146,10 @@ struct OptMuxtreeWorker log(" No muxes found in this module.\n"); return; } + + // Limit the number of iterations based on the number of muxes. + // The multiplier (100) is arbitrary. + glob_abort_cnt = GetSize(mux2info) * 100; // Populate mux2info[].ports[]: // .input_muxes From b5251b4802fc93f139b99be48b68743d2d60b341 Mon Sep 17 00:00:00 2001 From: Carlo Alberto Ferraris Date: Sun, 6 Nov 2022 21:59:40 +0900 Subject: [PATCH 2/3] Update opt_muxtree.cc --- passes/opt/opt_muxtree.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passes/opt/opt_muxtree.cc b/passes/opt/opt_muxtree.cc index fc71dc8c5..867fab9a3 100644 --- a/passes/opt/opt_muxtree.cc +++ b/passes/opt/opt_muxtree.cc @@ -148,8 +148,8 @@ struct OptMuxtreeWorker } // Limit the number of iterations based on the number of muxes. - // The multiplier (100) is arbitrary. - glob_abort_cnt = GetSize(mux2info) * 100; + // The multiplier (1000) is arbitrary. + glob_abort_cnt = GetSize(mux2info) * 1000; // Populate mux2info[].ports[]: // .input_muxes From d67989f9ad3f45da2a18b3706fdc04460f726a14 Mon Sep 17 00:00:00 2001 From: "N. Engelhardt" Date: Fri, 11 Nov 2022 14:53:32 +0100 Subject: [PATCH 3/3] update opt_muxtree iteration limit --- passes/opt/opt_muxtree.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passes/opt/opt_muxtree.cc b/passes/opt/opt_muxtree.cc index 867fab9a3..6c3a5ec69 100644 --- a/passes/opt/opt_muxtree.cc +++ b/passes/opt/opt_muxtree.cc @@ -149,7 +149,7 @@ struct OptMuxtreeWorker // Limit the number of iterations based on the number of muxes. // The multiplier (1000) is arbitrary. - glob_abort_cnt = GetSize(mux2info) * 1000; + glob_abort_cnt = max(100000, GetSize(mux2info) * 100); // Populate mux2info[].ports[]: // .input_muxes