The quantum keeper code is just a conditional resynch:
if (delay > myQ) { sc_wait(delay); delay = 0; }
By calling sc_wait(delay) the simulation time will advance to where the caller has got to while running other pending processes. The myQuantum could be a system default value or a special value for each thread or component.
(We here write sc_wait to emphasise it is the SystemC kernel primitive systemc::wait, not the unix call.)
Or where a thread needs to spin, waiting for a result from some other thread:
while (!condition_of_interest) { sc_wait(delay); delay = 0; }
Generally, we can choose the quantum according to our current modelling interest:
Transactions may execute in a different sequence from reality: sequential consistency compromised ? Bugs exposed?
34: (C) 2008-17, DJ Greaves, University of Cambridge, Computer Laboratory. |