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:
parent
f8d4d7128c
commit
bf4a46ccb3
2 changed files with 28 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue