29.11.2014 Views

Fast Models Reference Manual - ARM Information Center

Fast Models Reference Manual - ARM Information Center

Fast Models Reference Manual - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Peripheral and Interface Components<br />

5.9 SCADI<br />

A Synchronous CADI (SCADI) interface for components offers direct synchronous, but<br />

unsynchronized, register and memory read access. It enables you to request a synchronous stop<br />

of the simulation. The intention is that this interface is used by code that is inherently<br />

synchronized with the simulation, in particular from code that is part of the simulation itself<br />

(simulation thread). Examples for code that would be allowed to use this interface is SystemC<br />

or LISA peripheral device/bus access functions and MTI callback functions that are always<br />

called synchronously by the simulation itself.<br />

Note<br />

The SCADI interface is not a replacement for CADI in any way. It is an additional interface with<br />

clear semantics that differ slightly from CADI.<br />

5.9.1 Intended use of CADI and SCADI<br />

The design principles for CADI and SCADI are:<br />

CADI<br />

SCADI<br />

Used by debuggers and simulation controllers to control the simulation.<br />

Execution control functions are always asynchronous and are usually called from<br />

a non-simulation thread, usually the debugger GUI thread. You can also use<br />

CADI to read/write registers, memory and so on, but only from non-simulation<br />

threads, for example only from the debugger thread.<br />

Implements a specific subset of functions of CADI, that is, mainly read/write<br />

registers and memory, set and clear breakpoints, and get disassembly. You can<br />

only use SCADI from the simulation thread itself and from threads that can make<br />

sure on their own that the simulation is currently blocked, for example a debugger<br />

thread while it is sure that the simulation is in a stable state. SCADI is intended<br />

to be used from within peripheral read/write accesses while the simulation is<br />

running, or from within MTI callbacks that the simulation is running.<br />

SCADI does not implement and execute control functions except CADIExecStop(),<br />

because only stop makes sense from within the simulation thread. SCADI is the<br />

Synchronous CADI interface. Asynchronous functions such as<br />

CADIExecContinue() and CADIExecSingleStep() are not supported by SCADI, so<br />

for these you must use CADI instead. The SCADI::CADIExecStop() is the<br />

exception, because for CADI this means “stop when it is convenient for the<br />

simulation”, which is asynchronous, but CADIExecStop() is synchronous and<br />

means “stop now”, which you enable with the appropriate syncLevel >=2.<br />

The guideline is:<br />

• use CADI for execution control<br />

• use CADI or SCADI for read/write registers and memory, depending on the situation.<br />

That is:<br />

— use SCADI if the caller can make sure that the accesses are (potentially inherently)<br />

synchronized with the simulation<br />

— use CADI if called from a debugger thread that does not know exactly whether the<br />

simulation is running or is in a stable state.<br />

<strong>ARM</strong> DUI 0423J Copyright © 2008-2011 <strong>ARM</strong>. All rights reserved. 5-167<br />

ID051811<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!