4.7.1. Memory model initialization function

A memory model must export a function that is called during initialization. You must provide the memory model initialization function. If the model and the function are registered, and an armul.cnf entry is found, then the memory model initialization function is called.

The name of the function is defined by you. In the description below, the name MemInit is used.

Syntax

void  ARMul_Error armul_MemInit(struct ARMul_State *state,
                                ARMul_MemInterface *interf,
                                /* ARMul_MemType variant, */
                                toolconf your_config, toolconf core_config)

where:

state

is a pointer to the RVISS state.

interf

is a pointer to the memory interface structure. See the ARMul_MemInterface structure in armul_mem.h for an example.

variant

is the interface variant. See the ARMul_MemType enumeration in armul_mem.h. See Memory type variants for a description of the variants.

your_config

is the configuration database for your model or models.

core_config

is the configuration database for the core.

Return

This function returns either:

  • ARMulErr_NoError, if there is no error during initialization

  • an ARMul_Error value.

The error must be passed through Hostif_RaiseError() for formatting (see Hostif_RaiseError).

Usage

The initialization must set the handle for the model by assigning to interf->handle. The handle is usually a pointer to the state representing this instantiation of the model. RVISS passes this handle to all the access functions it calls.

Copyright © 2002-2007 ARM Limited. All rights reserved.ARM DUI 0207D
Non-Confidential