4.2. Communicating with the core

During initialization, all the models receive a pointer to an mdesc structure of type RDI_ModuleDesc *. They copy this structure into their own state as a field called coredesc. This is passed as the first parameter to most ARMulif (ARMulator interface) functions. ARMulator exports these functions to enable models to access the ARMulator state through this handle.

The following functions provide read and write access to ARM registers:

A model must pass a pointer to their coredesc structure when calling a function in ARMulif that calls the core.

The following functions provide convenient access to specific bits or fields in the CPSR:

The following functions call the read and write methods for a coprocessor:


It is not appropriate to access some parts of the state from certain parts of a model. For example, you must not set the contents of an ARM register from a memory access function, because the memory access function can be called during simulation of an instruction. In contrast, it is sometimes necessary to set the contents of ARM registers from a SWI handler function.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI0058D