Message Mapping
AUTOSAR does not know the concept of ASCET messages. If an ASCET module containing ASCET messages is used within an AUTOSAR software component, or if the AUTOSAR SWC itself contains messages, then all messages must be mapped to semantically equivalent AUTOSAR elements.
For this purpose, ASCET provides a special editor in the Message Mapping view of the software component editor.
Note |
|---|
Since ASCET V6.4.6, mapping messages to elements of NVData interfaces is no longer possible. Existing mappings of messages to elements of NVData interfaces must be converted to NV data mappings; see Mapping Conversion for details. SWCs that contain messages can be exported only in AMD format V6.4.8 and higher. An AMD format V6.4.7 or lower will result in an export error. |
In the Message Mapping view, messages can be mapped to AUTOSAR elements according to the following rules:
Messages can be mapped as shown in the following table.
internal mapping
external mapping
scalar messages
to scalar interrunnable variables
to scalar elements of SenderReceiver interfaces
to scalar elements of complex interrunnable variables
to scalar elements of complex elements (records) in SenderReceiver interfaces
composite messages (arrays, matrices)
to composite interrunnable variables
to composite elements (array, matrix) of SenderReceiver interfaces
to composite elements (arrays, matrices) of complex interrunnable variables
to composite elements (arrays, matrices) of complex elements in SenderReceiver interfaces
complex messages (records)
to complex interrunnable variables
to complex elements (records) in SenderReceiver interfaces
to complex elements (records) of complex interrunnable variables
to complex elements (records) of complex elements in SenderReceiver interfaces
Scalar and composite elements of nested records (record A contains record B, which contains record C, etc.) used as SenderReceiver interface elements or interrunnable variables are available for message mapping.
Note
Recursively nested records (record A contains record B, which contains record A) are forbidden; using them leads to a code generation error EMake10.
Complex elements of nested records (record A contains record B, which contains record C, etc.) used as SenderReceiver interface elements or interrunnable variables are not available for message mapping.
A scalar message must be mapped to a scalar element of
compatible type. If you map a scalar message to an element of compatible, but non-identical type, a warning WMdl635 is issued during code generation.
If you map a scalar message to an element of incompatible type, an error MMdl635 is issued during code generation.
A composite message (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 message (record) 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 mapped messages.
If it is, the following error MMdl37 is issued during code generation:
redundant data flag is set for <message>, but redundant data and mapped messages cannot be combined.
A pure send message can only be mapped to one or more elements of SenderReceiver interfaces used as Pport (external mapping), since the message value is not used within the SWC and thus provided to be used by another SWC.
A pure send message is a send message that appears as a send message in all modules of the software component, i.e. it is not received by another module. Its Get method is not activated. Import/export of the pure send message is permitted.
A send message with activated Get method can be mapped to one interrunnable variable (internal mapping) and/or one or more elements of SenderReceiver interfaces used as Pport (external mapping).
If you map such a message to an element of an Rport, an error MMdl271 is issued during code generation:
Invalid external access mapping for element "<message>" in "<component>" – mapping to elements of provide port supported only
If you map such a message only to an element of a Pport (i.e. no internal mapping), and use the Get method in the model, an error MMdl106 is issued during code generation:
Element "<element>" of provide port "<provide_port>" can not be read
A pure receive message can only be mapped to an element of a SenderReceiver interface used as Rport (external mapping), since the message value is not given within the SWC and must therefore be given by another SWC. Internal mapping is not provided for pure receive messages.
A pure receive message is a receive message that is not used as send message within the modules of the SWC. Its Set method is not activated.
A receive message with activated Set method can be mapped to one interrunnable variable (internal mapping) and/or one element of a SenderReceiver interface used as Rport (external mapping).
If you map such a message to an element of a Pport, an error MMdl271 is issued during code generation:
Invalid external access mapping for element "<message>" in "<component>" – mapping to elements of require port supported only
If you map such a message only to an element of an Rport (i.e. no internal mapping), and use the Set method in the model, an error MMdl107 is issued during code generation:
Element "<element>" of require port "<require_port>" can not be written
All other messages, i.e. SendReceive messages and messages specified as send message in one module and as receive message in another module, can be mapped to an interrunnable variable (internal mapping) or to an element of a SenderReceiver interface used as Pport (external mapping).
If you map a SendReceive message with activated Get and/or Set method to an element of an Rport, an error MMdl271 is issued during code generation.
- Pure receive messages can have one external mapping. Pure send messages and other messages can have multiple external mappings.
- Pure send messages and pure receive messages cannot have an internal mapping. Other messages can have one internal mapping.
- Imported messages must have only one internal mapping. If you apply an external mapping, too, an error MMdl274 is issued during code generation.
Internal mapping is indicated as complete if each mappable message is mapped. External mapping is indicated as complete if each mappable message is mapped once. However, you can still map messages that allow multiple mapping.
To ease reuse of ASCET modules in SWCs, it is possible to export mappings from one SWC and import them into another SWC. You can export mappings either in an XML format or as a list of comma-separated values (*.csv). In both cases, the following information is stored for each mapping:
mapping location, message name, AUTOSAR element name
In addition, the XML export file contains further details on message and AUTOSAR element.
Both valid and invalid mappings are exported; incomplete mappings are not exported. Examples for both export formats are given in Example: Mapping Export Files.
See also