3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-10 13:10:51 +00:00

proc_rom: don't assert on big actionless switch.

See the test case.  PROC_ROM will consider this for evaluation, even
though -- without any actions -- lhs is empty (but still "uniform").
A zero-width memory is constructed, which later fails check with:

ERROR: Assert `width != 0' failed in kernel/mem.cc:518.

Ensure we don't proceed if there's nothing to encode.
This commit is contained in:
Amelia Cuss 2024-02-18 01:30:28 +11:00
parent f8d4d7128c
commit bf4a46ccb3
2 changed files with 28 additions and 0 deletions

View file

@ -186,4 +186,27 @@ design -stash preopt
equiv_opt -assert -run prepare: dummy
design -reset
read_ilang <<EOT
module \m
wire width 3 input 1 \a
process \p
switch \a
case 3'000
case 3'001
case 3'010
case 3'011
case 3'100
case 3'101
case 3'110
case 3'111
end
end
end
EOT
proc_rom