3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 09:05:32 +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

@ -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)