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 measurement and
calibration.
To model AUTOSAR static memory, you can use Simulink block signals, discrete states, or data stores in your model.
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 model
autosar_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 and displays the signal
attributes in the Property Inspector. Use the Property Inspector to modify
the signal attributes. In the Mapped To drop-down list,
select StaticMemory
. 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
. Use the Property Inspector to modify the state
attributes. From the Mapped To drop-down list, select
StaticMemory
.
When you generate code:
Exported ARXML files contain STATIC-MEMORYS
descriptions for signals and states that you configured as
StaticMemory
.
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 reference
or to AUTOSAR StaticMemory
for single-instance model
reference.
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 model
autosar_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 and
displays the data store attributes in the Property Inspector. Use the
Property Inspector to modify the data store attributes. From the
Mapped To drop-down list, select
StaticMemory
. 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 as
StaticMemory
.
Generated C code declares and references the static memory variables.
Note
AUTOSAR Blockset does not support static memory code generation for data stores in referenced models.
Data Store Memory | getDataStore
| getSignal
| getState
| mapDataStore
| mapSignal
| mapState