5.19.1 Sync points
A sync point is a point at which the simulation can detect whether it needs to stop and at which it can start and stop producing trace and events. The sync level determines where the sync points are in terms of simulated time.
5-15 Sync levels and sync points
simulation speed. No accuracy guarantees. In particular, the
simulation cannot be stopped immediately, even from synchronous
callbacks or model code, and the values of the PC and
instruction count registers are generally out of date, even when
read from synchronous callbacks or model code.
- Simulations that do not require immediate stopping of any
- Free-running simulations that are used for software
- Normal debugging sessions when no watchpoint is set.
The sync point is the end of the current quantum.
SYNC_STATE. Slightly slower than 0. It is
possible to read up-to-date resource values from synchronous
syncEc=True) from the model and
model code, for example the PC register. The simulation cannot
be stopped immediately from within synchronous callbacks or
- External breakpoints that block the simulation.
- Inspecting the processor state from within peripheral
POST_INSN_IO. Similar to 1 but slightly slower, and the simulation can be stopped immediately while executing I/O (LD/ST) instructions from within synchronous callbacks and model code by using the
simulationTime_stop() function. The simulation stops after the currently executed I/O (LD/ST) instruction has completed.
The sync point is the same as for sync level 1, but additionally after every I/O instruction.
- External breakpoints, in other words, breakpoints that are set in peripherals, behind a bridge.
- Complex breakpoints built from LD/ST-related events.
POST_INSN_ALL. Similar to 2 but slightly slower, and the simulation can be stopped immediately, independently of the instruction being executed. The simulation stops after the currently executed instruction has completed.
The sync point is the same as for sync level 2, but additionally after every instruction.
- Complex breakpoints that are built from arbitrary events.
Some use cases that require specific sync levels:
- Watchpoints, or memory breakpoints, require sync level 2. This is handled transparently by the
model and the sync level does not need to be requested by the watchpoint
- External breakpoints that can stop the simulation use sync level 2.
- Trace event-based breakpoints usually require sync level 2 or 3.
- Events that inspect the state of cores, in particular the PC and instruction
count, from within the
require sync level 1.