The clock synchronization module is used to slave the simulation to realtime. The module is controlled by specifying an acceleration factor which can be adjusted dynamically if the timeInitialized factor is also reset dynamically.
class ClockSynch : public SysModel¶
- #include <simSynch.h>
clock sync model class
This is the constructor for the clock synch model. It sets default variable values and initializes the various parts of the model
Destructor. Nothing here.
void Reset(uint64_t currentSimNanos)¶
Reset the module variables.
void UpdateState(uint64_t currentSimNanos)¶
This method performs all of the runtime behavior for the clock synch model. It initializes the timers present in the model on the first pass and then ensures that the model stays stuck on the synchronization pulse. Note that we do the init on the first pass instead of the init routines so that we don’t have a big lag between initialization and runtime which messes up our clocking.
currentSimNanos – The clock time associated with the model call
[-] Factor used to accelerate sim-time relative to clock
ns Level of accuracy that we want out of the timer, default is 10ms
[-] Flag indicating that we want to display the time elapsed in cmd line, default is off
— BSK Logging