Configure AUTOSAR Static Memory
To model AUTOSAR static memory for AUTOSAR applications, you import static memory definitions from ARXML files or create static memory content in Simulink®. For information about the high-level static memory workflow, see Static and Constant Memory.
AUTOSAR static memory (StaticMemory
) corresponds to Simulink internal global signals. In the AUTOSAR run-time environment, calibration tools can access StaticMemory
blocks for calibration and measurement.
To model AUTOSAR static memory, you can use Simulink block signals, discrete states, or data stores in your model.
Configure Block Signals and States as AUTOSAR Static Memory
To generate StaticMemory
blocks for Simulink block signal and discrete state data in your AUTOSAR model, open the Code Mappings editor and select the Signals/States tab. Select signals and states and map them to StaticMemory
. For example:
Open an AUTOSAR model that contains signals or states that you want to generate
StaticMemory
blocks for. This example uses modelautosar_swc_counter
.In the AUTOSAR Code perspective, open the Code Mappings editor and select the Signals/States tab. In the list of available signals, select
equal_to_count
. Selecting a signal highlights the signal in the model diagram. In the Mapped To drop-down list, selectStaticMemory
. To view and modify AUTOSAR attributes for the static memory, click the icon. For more information about signal code and calibration attributes, see Map Block Signals and States to AUTOSAR Variables.Select the Signals/States tab, and then select state
X
. From the Mapped To drop-down list, selectStaticMemory
. To view and modify AUTOSAR attributes for the static memory, click the icon.
When you generate code:
Exported ARXML files contain
STATIC-MEMORYS
descriptions for signals and states that you configured asStaticMemory
.Generated C code declares and references the static memory variables.
For referenced models within an AUTOSAR component model, Embedded Coder® maps internal signals and states for model reference code generation.
Internal signals and states map to AUTOSAR ArTypedPerInstanceMemory
for multi-instance model references. For single-instance model references states are
mapped to AUTOSAR StaticMemory
.
Configure Data Stores as AUTOSAR Static Memory
To generate StaticMemory
blocks for Simulink data store memory blocks in your AUTOSAR model, open the Code Mappings editor and select the Data Stores tab. Select data stores and map them to StaticMemory
. For example:
Open an AUTOSAR model that contains data stores that you want to generate
StaticMemory
blocks for. This example uses modelautosar_bsw_sensor1
.In the AUTOSAR Code perspective, open the Code Mappings editor and select the Data Stores tab. From the list of available data stores, select data store
LowSetPoint
. Selecting a data store highlights the data store memory block in the model diagram. From the Mapped To drop-down list, selectStaticMemory
. To view and modify AUTOSAR attributes for the static memory, click the icon. For more information about data store code and calibration attributes, see Map Data Stores to AUTOSAR Variables.
When you generate code:
Exported ARXML files contain
STATIC-MEMORYS
descriptions for data stores that you configured asStaticMemory
.Generated C code declares and references the static memory variables.
Note
AUTOSAR Blockset does not support static memory code generation for signals and data stores in referenced models.
See Also
getDataStore
| getSignal
| getState
| mapDataStore
| mapSignal
| mapState
| Data Store Memory
Related Examples
- Map Block Signals and States to AUTOSAR Variables
- Map Data Stores to AUTOSAR Variables
- Model AUTOSAR Component Behavior