Open
Description
When awaiting a TriggerCombination that waits for both a delay() to expire and a signal to change, if the delay expires at the same time as when the signal changes, BrokenTrigger is thrown.
Here is minimal example code:
from amaranth import *
from amaranth.sim import Simulator
sig = Signal()
class Dut(Elaboratable):
def elaborate(self, platform):
m = Module()
return m
dut = Dut()
async def bench_a(ctx):
await ctx.delay(1e-6)
await ctx.delay(0.5e-6).changed(sig)
async def bench_b(ctx):
await ctx.delay(1e-6)
await ctx.delay(0.5e-6)
ctx.set(sig, 1)
sim = Simulator(dut)
sim.add_testbench(bench_b)
sim.add_testbench(bench_a)
with sim.write_vcd("t.vcd"):
sim.run()
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
purdeaandrei commentedon Sep 9, 2024
Looks like BrokenTrigger can also happen with a single
.changed()
trigger that lists more than one signal.whitequark commentedon Sep 9, 2024
That sounds plausible, yeah.