NV Data Mapping
In case an ASCET class, state machine, or module containing non-volatile variables (NV variables) is used within an AUTOSAR software component, all NV variables (except local NV variables in classes) can be mapped to semantically equivalent AUTOSAR elements. Unlike messages, however, you do not have to map NV variables, you can access them in the normal way.
For this purpose, ASCET provides a special editor1 in the NV-Data Mapping view of the software component editor. In that editor, NV variables can be mapped to AUTOSAR elements according to the following rules:
NV variables of all scopes – exported, imported, local – can be mapped to NVData interface elements, with one exception:
Local NV variables in classes cannot be mapped to NVData interface elements.
You must not map NV variables that are written in your model to NVData interfaces used as Rports.
If you do, an error MMdl2761 is issued during code generation.
Note
You cannot create NVData interface Pports in ASCET, but you can import ARXML files that contain NVData interface Pports.
One NV variable can be mapped at most to one NVData interface Rport and one NVData interface Pport.
NV variables can be mapped as shown in the following table.
mapping
scalar NV variables
to scalar elements of NVData interfaces
to scalar elements of complex elements (records) in NVData interfaces
composite NV variables (arrays, matrices)
to composite elements (arrays) of NVData interfaces
to composite elements of complex elements (records) in NVData interfaces
complex NV variables (records)
to complex elements (records) in NVData interfaces
to complex elements of complex elements in NVData interfaces
A scalar NV variable must be mapped to a scalar element of compatible type.
NV variable type
AUTOSAR element type
Continuous (cont)
cont / limitInt / wrapInt / sdisc / udisc
Limited Integer (limitInt)
limitInt / wrapInt
Wrap-Around Integer (wrapInt)
wrapInt
Signed Discrete (sdisc)
cont / limitInt / wrapInt / sdisc / udisc
Unsigned Discrete (udisc)
cont / limitInt / wrapInt / sdisc / udisc
Logic (log)
log
Enumeration (enum)
Enumeration of the same type
If you map a scalar NV variable to an element of compatible, but non-identical type, a warning WMdl635 is issued during code generation.
If you map a scalar NV variable to an element of incompatible type, an error MMdl635 is issued during code generation.
A composite NV variable (array, matrix) must be mapped to an array/matrix of identical size, data type and implementation.
Otherwise, the mapping is indicated as invalid, and an error MMdl635 is issued during code generation.
A complex NV variable must be mapped to a record of identical type and implementation.
Otherwise, the mapping is indicated as invalid, and an error MMdl635 is issued during code generation.
Redundant data storage must not be activated for NV variables.
If it is, the following error MMdl37 is issued during code generation.
Note |
|---|
SWCs sthat use NV data mapping can only be exported to ASCET V6.4.6 or newer. |
See also