5.19.2 Simulation accuracy (sync level) functions

Describes the following functions:

syncLevel_get()

Queries the current sync-level state. This is only provided for debugging purposes. Clients must not rely on the values returned by this function because other clients might explicitly change the sync level, or might implicitly change it using watchpoints.

Arguments

instId

Type: NumberU64

Opaque number uniquely identifying the target instance.

Return value

SyncLevelState

Current sync-level value and the number of registered users for each sync level. See SyncLevelState.

Errors

  • E_unknown_instance_id.
  • E_unknown_sync_level.

syncLevel_release()

Releases a previous request for a minimum sync level. This signals that the client no longer requires that the sync level of the instance goes no lower than the released level.

Arguments

instId

Type: NumberU64

Opaque number uniquely identifying the target instance.

syncLevel

Type: NumberU64

Requested minimum sync level:

"0" ("OFF")

Maximum 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.

Use cases: Simulations that do not require immediate stopping of any kind. Free-running simulations used for software development. Normal debugging sessions when no watchpoint is set.

The sync point, which is the point at which the simulation can detect that it needs to stop and can start and stop generating trace and events, is the end of the current quantum.

"1" ("SYNC_STATE")

Slightly slower than 0. It is possible to read up-to-date resource values from synchronous callbacks from the model (syncEc=True) and model code, for example the PC register. The simulation cannot be stopped immediately from within synchronous callbacks or model code.

Use cases: External breakpoints that block the simulation. Inspecting the processor state from within peripheral accesses.

Sync point is the same as for sync level 0.

"2" ("POST_INSN_IO")

Slightly slower than 1. Like 1 but the simulation can be stopped immediately while executing I/O (LD/ST) instructions from within synchronous callbacks and model code, using the simulationTime_stop() function. The simulation stops after the currently executing I/O (LD/ST) instruction has completed.

Use cases: Watchpoints. External breakpoints (breakpoints in peripherals). Complex breakpoints built from LD/ST-related events.

Sync point is the same as for sync level 1 plus after every I/O instruction.

"3" ("POST_INSN_ALL")

Slightly slower than 2. Like 2 but the simulation can be stopped immediately, independently of the instruction currently executing. The simulation stops after the currently executing instruction has completed.

Use cases: Complex breakpoints built from arbitrary events.

Sync point is the same as for sync level 2 plus after every instruction.

Return value

Function has no return value.

Errors

  • E_unknown_instance_id.
  • E_unknown_sync_level.

syncLevel_request()

Requests a minimum sync level. This signals that the sync level of the instance must go no lower than the level requested.

Arguments

instId

Type: NumberU64

Opaque number uniquely identifying the target instance.

syncLevel

Type: NumberU64

Requested minimum sync level:

"0" ("OFF")

Maximum 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.

Use cases: Simulations that do not require immediate stopping of any kind. Free-running simulations used for software development. Normal debugging sessions when no watchpoint is set.

The sync point, which is the point at which the simulation can detect that it needs to stop and can start and stop generating trace and events, is the end of the current quantum.

"1" ("SYNC_STATE")

Slightly slower than 0. It is possible to read up-to-date resource values from synchronous callbacks from the model (syncEc=True) and model code, for example the PC register. The simulation cannot be stopped immediately from within synchronous callbacks or model code.

Use cases: External breakpoints that block the simulation. Inspecting the processor state from within peripheral accesses.

Sync point is the same as for sync level 0.

"2" ("POST_INSN_IO")

Slightly slower than 1. Like 1 but the simulation can be stopped immediately while executing I/O (LD/ST) instructions from within synchronous callbacks and model code, using the simulationTime_stop() function. The simulation stops after the currently executing I/O (LD/ST) instruction has completed.

Use cases: Watchpoints. External breakpoints (breakpoints in peripherals). Complex breakpoints built from LD/ST-related events.

Sync point is the same as for sync level 1 plus after every I/O instruction.

"3" ("POST_INSN_ALL")

Slightly slower than 2. Like 2 but the simulation can be stopped immediately, independently of the instruction currently executing. The simulation stops after the currently executing instruction has completed.

Use cases: Complex breakpoints built from arbitrary events.

Sync point is the same as for sync level 2 plus after every instruction.

Return value

Function has no return value.

Errors

  • E_unknown_instance_id.
  • E_unknown_sync_level.
Non-ConfidentialPDF file icon PDF version101196_0100_03_en
Copyright © 2018, 2019 Arm Limited or its affiliates. All rights reserved.