Previous - Up - Next

4.5   Events

Sometimes a module needs to execute some code a fixed amount of simulated time into the future. This can be achieved by posting an event, which will cause a callback function to be called when a specified amount of time has passed. There are two event queues in Simics, the time queue which measures simulated time, and the step queue that measures simulated steps. Devices should generally use the time queue, unless they are interested in the exact number of CPU steps. A device that wants to raise a timer interrupt every 10 ms is an example of a module that should use the time queue. A profiling module that wants to sample the program counter every 10th step should on the other hand use the step queue. You can print out the current event queue by using the print-event-queue or piq command.

The Simics User Guide describes event scheduling and timing in more detail. For more information about event handling in DML, refer to section 5.5. For C and Python, refer to section 6.7.

Previous - Up - Next