back.pysim: trigger processes waiting on Tick() exactly at clock edge.
This commit is contained in:
parent
d6e98fd934
commit
34b81d0b87
|
@ -539,6 +539,13 @@ class Simulator:
|
||||||
del self._wait_tick[process]
|
del self._wait_tick[process]
|
||||||
self._suspended.remove(process)
|
self._suspended.remove(process)
|
||||||
|
|
||||||
|
# Immediately run the process. It is important that this happens here,
|
||||||
|
# and not on the next step, when all the processes will run anyway,
|
||||||
|
# because Tick() simulates an edge triggered process. Like DFFs that latch
|
||||||
|
# a value from the previous clock cycle, simulator processes observe signal
|
||||||
|
# values from the previous clock cycle on a tick, too.
|
||||||
|
self._run_process(process)
|
||||||
|
|
||||||
# Unless handling synchronous logic above has triggered more synchronous logic (which
|
# Unless handling synchronous logic above has triggered more synchronous logic (which
|
||||||
# can happen e.g. if a domain is clocked off a clock divisor in fabric), we're done.
|
# can happen e.g. if a domain is clocked off a clock divisor in fabric), we're done.
|
||||||
# Otherwise, do one more round of updates.
|
# Otherwise, do one more round of updates.
|
||||||
|
|
Loading…
Reference in a new issue