You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
changed the title [-]`ctx.get()` returns wrong values that never appear in the VCD[/-][+]VCD files do not display glitches and can get extremely confusing[/+]on Jun 19, 2024
@wanda-phi has narrowed down the issue to the two underlying causes (thanks!). These are:
Circuits that provide combinational feedback from control to status signals, when used together with testbenches that use .get() and .set(), easily cause race conditions.
The VCD files do not display glitches that arise from these race conditions.
It is much easier to tackle (2) alone so that's what we should do.
A testbench samples it after the posedge using get() and manipulates a control signal. (This is violating Amaranth's execution model: the testbench is not acting like a synchronous circuit.)
The change to the control signal causes the status signal to be deasserted again.
On the next posedge, the circuit acts on the deasserted value of the status signal, missing an event.
Activity
[-]`ctx.get()` returns wrong values that never appear in the VCD[/-][+]VCD files do not display glitches and can get extremely confusing[/+]whitequark commentedon Jun 19, 2024
@wanda-phi has narrowed down the issue to the two underlying causes (thanks!). These are:
.get()
and.set()
, easily cause race conditions.It is much easier to tackle (2) alone so that's what we should do.
whitequark commentedon Jun 19, 2024
In this particular case, the race condition is:
get()
and manipulates a control signal. (This is violating Amaranth's execution model: the testbench is not acting like a synchronous circuit.)