diff --git a/passes/proc/proc_rom.cc b/passes/proc/proc_rom.cc index b83466ce7..ebc2377aa 100644 --- a/passes/proc/proc_rom.cc +++ b/passes/proc/proc_rom.cc @@ -66,6 +66,11 @@ struct RomWorker } } + if (lhs.empty()) { + log_debug("rejecting switch: lhs empty\n"); + return; + } + int swsigbits = 0; for (int i = 0; i < GetSize(sw->signal); i++) if (sw->signal[i] != State::S0) diff --git a/tests/proc/proc_rom.ys b/tests/proc/proc_rom.ys index 0ef2e2c61..93fd5002b 100644 --- a/tests/proc/proc_rom.ys +++ b/tests/proc/proc_rom.ys @@ -186,4 +186,27 @@ design -stash preopt equiv_opt -assert -run prepare: dummy +design -reset +read_ilang <