The code for this setup will be demonstrated in lectures.
In this reference example, for each CPU core, a single thread is used that passes between components and back to the originator and only rarely enters the SystemC Kernel.
As explained above, each thread has a variable called delay of how far it has run ahead of kernel simulation time, and it only yields when it needs an actual result from another thread or because its delay exceeds a locally-chosen value.
Each component increments the delay field in the TLM calls it processes, according to how long it would have delayed the client thread under approximate timing.
Each component may have a quantum keeper. Every thread must encounter a quantum keeper at least once in its outermost loop.
|27: (C) 2008-13, DJ Greaves, University of Cambridge, Computer Laboratory.|