| |||
| Home > RVISS Reference > Memory model interface > 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.
void ARMul_Error armul_MemInit(struct ARMul_State *state, ARMul_MemInterface *interf, /* ARMul_MemTypevariant, */ toolconfyour_config, toolconfcore_config)
where:
stateis a pointer to the RVISS state.
interfis a pointer to the memory interface structure.
See the ARMul_MemInterface structure in armul_mem.h for
an example.
variantis the interface variant. See the ARMul_MemType enumeration
in armul_mem.h. See Memory type variants for a description of the variants.
your_configis the configuration database for your model or models.
core_configis the configuration database for the core.
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).