3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-05-12 02:04:44 +00:00
This commit is contained in:
Carlo Alberto Ferraris 2025-05-08 16:07:26 +00:00 committed by GitHub
commit c4a2457ce9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,7 +36,7 @@ struct OptMuxtreeWorker
RTLIL::Module *module; RTLIL::Module *module;
SigMap assign_map; SigMap assign_map;
int removed_count; int removed_count;
int glob_abort_cnt = 100000; int glob_abort_cnt;
struct bitinfo_t { struct bitinfo_t {
bool seen_non_mux; bool seen_non_mux;
@ -146,6 +146,10 @@ struct OptMuxtreeWorker
log(" No muxes found in this module.\n"); log(" No muxes found in this module.\n");
return; return;
} }
// Limit the number of iterations based on the number of muxes.
// The multiplier (1000) is arbitrary.
glob_abort_cnt = max(100000, GetSize(mux2info) * 100);
// Populate mux2info[].ports[]: // Populate mux2info[].ports[]:
// .input_muxes // .input_muxes