hdl._ast: change Switch to operate on list of cases.

This commit is contained in:
Wanda 2024-04-02 23:04:56 +02:00 committed by Catherine
parent cd6cbd71ca
commit 2eb62a8b49
8 changed files with 95 additions and 90 deletions

View file

@ -638,6 +638,8 @@ class ModuleEmitter:
assert isinstance(matches_cell, _nir.Matches)
assert test == matches_cell.value
patterns = matches_cell.patterns
# RTLIL cannot support empty pattern sets.
assert patterns
with switch.case(*patterns) as subcase:
emit_assignments(subcase, subcond)
emitted_switch = True