A realtime object will, when enabled, periodically check the simulation speed and wait for a while if it is too high. speed specifies how fast simulated time is allowed to run, in percent of real time; default is 100. check_interval specifies how often the check should take place, in milliseconds of simulated time; default is 1000. Higher values give better performance; lower values reduce the maximum difference between real and simulated time. Setting this to less than set-time-quantum
has no effect.
The speed argument says how fast the simulation should run, but the actual speed will always deviate a little from that value even if the host is fast enough. To keep these errors from accumulating, the simulation speed has to be adjusted; drift-compensate regulates how much it may be adjusted. If set to (for example) 0.25, simulation speed may be increased or decreased by up to 25% if necessary to make up for any accumulated drift with respect to real time. If set to zero (the default), the simulation speed may not be changed at all from its set value.
The clock will control which clock is used for real-time comparison. A configuration may have many clocks/processors. Virtual time is based on a Simics clock and by default the first clock found is used to control real-time mode. However, some use cases may allow clocks to drift apart significantly, which may affect real-time mode. In such a case, it may be useful to use the clock argument. Notice that the clock can not be changed after the real-time command has been invoked.
Control this feature by the enable-real-time-mode
and disable-real-time-mode
commands. The real-time-mode
command will query whether real-time is enabled or not.
It is possible to run the enable-real-time-mode
command before any cycle object exists in the configuration. In this case creation of the realtime object will be postponed until a cycle object has been created. Run disable-real-time-mode
to inhibit postponed mode.