sim: fix using 0-width Switch.

This commit is contained in:
Wanda 2024-02-14 00:10:29 +01:00 committed by Catherine
parent 8033ddf05e
commit 0ecd06a7e5
2 changed files with 13 additions and 1 deletions

View file

@ -1064,6 +1064,18 @@ class SimulatorIntegrationTestCase(FHDLTestCase):
m.d.comb += a.eq(op)
Simulator(m)
def test_switch_zero(self):
m = Module()
a = Signal(0)
o = Signal()
with m.Switch(a):
with m.Case(""):
m.d.comb += o.eq(1)
with self.assertSimulation(m) as sim:
def process():
self.assertEqual((yield o), 1)
sim.add_testbench(process)
class SimulatorRegressionTestCase(FHDLTestCase):
def test_bug_325(self):