Example: Memory Class for Redundant Data Storage
For the memory class IRAM, the associated memory section RED_MEM for redundant data storage is specified in memorySections.xml:
...
<MemClass>
<name>IRAM</name>
...
<redundantMemClass>RED_MEM</redundantMemClass>
</MemClass>
...
<MemClass>
<name>RED_MEM</name>
...
</MemClass>
...
The redundant variable cont_local
is
assigned to the IRAM memory
section.
Note |
|---|
The *.c and *.h files have been generated for the PC target with Implementation Experiment code generator. |
In the generated header file, the assignment of cont_local and its complement _ASCET_copy_cont_local to memory classes can be seen in the following place:
/* begin region Type_Definitions */
...
* ----------------------------------------------------------------------------
* memory class:.................................'IRAM'
* ---------------------------------------------------------------------------*/
struct MODULE_IMPL_IRAM_SUBSTRUCT {
sint16 cont_local; /* min=-32768.0, max=32767.0, ident, limit=yes */
};
...
* ----------------------------------------------------------------------------
* memory class:.................................'RED_MEM'
* ---------------------------------------------------------------------------*/
struct MODULE_IMPL_RED_MEM_SUBSTRUCT {
uint16 _ASCET_copy_cont_local; /* min=0, max=65535, limit=yes */
};
/* end region Type_Definitions */
In the generated C file, the assignment of cont_local and its complement _ASCET_copy_cont_local to memory classes can be seen in the following place:
/* begin region Module_Data_Definitions */
...
/******************************************************************************
* BEGIN: DEFINITION OF SUBSTRUCT VARIABLE 'Module_IRAM'
...
* ---------------------------------------------------------------------------*/
struct MODULE_IMPL_IRAM_SUBSTRUCT Module_IRAM = {
/* struct element:'Module_IRAM.cont_local' (modeled as:'cont_local.Module') */
11
};
...
/******************************************************************************
* BEGIN: DEFINITION OF SUBSTRUCT VARIABLE 'Module_RED_MEM'
...
struct MODULE_IMPL_RED_MEM_SUBSTRUCT Module_RED_MEM = {
/* struct element:'Module_RED_MEM._ASCET_copy_cont_local' (modeled as:'_ASCET_copy_cont_local.Module') */
complementService(11)
};
...
/* end region Module_Data_Definitions */
