Skip to content

Commit 0f14153

Browse files
committed
test_sim: add test for abandoned repeated tick trigger
See issue #1638.
1 parent 26f5ee5 commit 0f14153

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_sim.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,6 +2077,16 @@ async def change(ctx):
20772077
sim.add_clock(Period(s=4))
20782078
sim.run()
20792079

2080+
def test_abandon_repeat(self):
2081+
m = Module()
2082+
toggle = Signal(1)
2083+
m.d.sync += toggle.eq(~toggle)
2084+
sim = Simulator(m)
2085+
async def process(ctx):
2086+
await ctx.tick().repeat(100)
2087+
sim.add_process(process)
2088+
sim.run()
2089+
20802090
def test_trigger_wrong(self):
20812091
a = Signal(4)
20822092
m = Module()

0 commit comments

Comments
 (0)