You can model AUTOSAR constant memory for AUTOSAR applications. To model AUTOSAR constant memory, import constant memory definitions from ARXML files or create constant memory content in Simulink®. For information about the high-level constant memory workflow, see Static and Constant Memory.
AUTOSAR constant memory (ConstantMemory
) corresponds to Simulink internal global parameters. In the AUTOSAR run-time environment,
calibration tools can access ConstantMemory
blocks for measurement
and calibration.
To model AUTOSAR constant memory, you can use Simulink model workspace parameters in your model. To generate
ConstantMemory
blocks for model workspace parameter data in your
AUTOSAR model, open the Code Mappings editor. Use the Parameters
tab to map parameters to ConstantMemory
. For example:
Open an AUTOSAR model that contains model workspace parameters for which you
want to generate ConstantMemory
blocks. This example uses
model autosar_swc_counter
.
In the AUTOSAR code perspective, open the Code Mappings editor and select the
Parameters tab. In the list of available parameters,
select INC
. Selecting a parameter displays the parameter
attributes in the Property Inspector. Use the Property Inspector to modify the
parameter attributes. In the Mapped To drop-down list,
select ConstantMemory
. For more information about
parameter code and calibration attributes, see Map Model Workspace Parameters to AUTOSAR Component Parameters.
When you generate code:
Exported ARXML files contain CONSTANT-MEMORYS
descriptions
for parameters that you configured as
ConstantMemory
.
Generated C code declares and references the constant memory parameters.