Configure AUTOSAR Constant Memory
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 calibration
and measurement.
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 modelautosar_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
. In the Mapped To drop-down list, selectConstantMemory
. To view and modify AUTOSAR attributes for the constant memory, click the icon. 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 asConstantMemory
.Generated C code declares and references the constant memory parameters.