Automatic Mapping
Mapping each individual message, NV variables
, or imported parameter can be time-consuming if you have a lot of these elements. To simplify the task, the software component editor provides an auto-mapping function.
By default, auto-mapping maps messages, NV variables, or imported parameters and AUTOSAR elements with identical names. To make auto-mapping more effective, you can define patterns that are used to map messages, NV variables, or imported parameters and AUTOSAR elements with different names. With these patterns, you can, for example, take into account prefixes and/or postfixes.
Default patterns are defined in the ASCET options, Appearance\Editors\Software Component node. These patterns are available in the combo boxes of the Parameter Mapping view, the Internal Access and External Access tabs of the Message Mapping view, and in the NV-Data Mapping view. You can add your own patterns, either via the ASCET options window or via the combo boxes.
Auto-mapping automatically maps unconnected messages, NV variables, or imported parameters in the software component to AUTOSAR elements with a matching name and type (i.e. scalar, array, matrix, or record) according to the following heuristic:
Parameter Mapping tab
- An imported parameter is mapped to a Calibration interface element with a matching name and type.
Internal Access tab
- A message with several matching counterparts is mapped to the first counterpart. Other counterparts are ignored.
External Access tab
- A message labeled as S or S/R in the Mapping field with several matching counterparts is mapped to each counterpart.
- A message labeled as R in the Mapping field is mapped to the first matching counterpart. Other counterparts are ignored.
NV-Data Mapping tab
- An NV variable is mapped to an element of an NVData interface with a matching name and type.
Note |
|---|
There is no guarantee that a message, NV variable, or imported parameter and an AUTOSAR element with matching names represent the same concept. For example, a message named Speed that represents speed in km/h is not the same as an AUTOSAR element named Speed that represents speed in miles/h. You must therefore verify that any auto-mappings represent valid connections. |
Matching names are derived from the currently selected pattern.
Parameter Mapping tab
%IMPORTED.NAME% is the template for names of elements in the Imported Parameter column, %CALIBRATION.NAME% is the template for names of elements in the Calibration Parameter column.
Internal Access tab and External Access tab
%MESSAGE.NAME% is the template for names of elements in the respective Messages column, %VARIABLE.NAME% is the template for names of elements in the respective Variables column.
NV-Data Mapping tab
%NVVARIABLE.NAME% is the template for names of NV variables in the NV Variables column, %ELEMENT.NAME% is the template for names of elements in the NV-Data Interface elements column.
If you add a prefix or postfix to one of these templates, auto-mapping works as shown in the following table.
pattern | auto-mapping result | |
Parameter Mapping tab | prefix_%IMPORTED.NAME% | An imported parameter name and a Calibration parameter prefix_name of the same type (i.e. scalar, array, matrix, or record) are mapped. |
%IMPORTED.NAME%_postfix | An imported parameter name and a Calibration parameter name_postfix of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
prefix_%CALIBRATION.NAME% | An imported parameter prefix_name and a Calibration parameter name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
%CALIBRATION.NAME%_postfix | An imported parameter name_postfix and a Calibration parameter name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
Note Names of classes, modules, Calibration interfaces or records are not considered. | ||
Internal Access tab | prefix_%MESSAGE.NAME% | A message name and an interrunnable variable prefix_name of the same type (i.e. scalar, array, matrix, or record) are mapped. |
%MESSAGE.NAME%_postfix | A message name and an interrunnable variable name_postfix of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
prefix_%VARIABLE.NAME% | A message prefix_name and an interrunnable variable name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
%VARIABLE.NAME%_postfix | A message name_postfix and an interrunnable variable name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
Note Names of modules or records are not considered. | ||
External Access tab | prefix_%MESSAGE.NAME% | A message name and an interface element prefix_name of the same type (i.e. scalar, array, matrix, or record) are mapped. |
%MESSAGE.NAME%_postfix | A message name and an interface element name_postfix of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
prefix_%VARIABLE.NAME% | A message prefix_name and an interface element name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
%VARIABLE.NAME%_postfix | A message name_postfix and an interface element name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
Note Names of modules, SenderReceiver interfaces or records are not considered. | ||
NV-Data Mapping tab | prefix_%NVVARIABLE.NAME% | An NV variable name and an interface element prefix_name of the same type (i.e. scalar, array, matrix, or record) are mapped. |
%NVVARIABLE.NAME%_postfix | An NV variable name and an interface element name_postfix of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
prefix_%ELEMENT.NAME% | An NV variable prefix_name and an interface element name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
%ELEMENT.NAME%_postfix | An NV variable name_postfix and an interface element name of the same type (i.e. scalar, array, matrix, or record) are mapped. | |
Note Names of classes, modules, NVData interfaces, or records are not considered. | ||
Keep in mind the following rules when you define a template:
- You can add a prefix, or a postfix, or both.
- Prefixes and postfixes are case-sensitive; a pattern PREFIX_<name> will not match a message or AUTOSAR element prefix_<name>.
- You cannot use %IMPORTED.NAME% and %CALIBRATION.NAME% in the same pattern for parameter mapping.
- You cannot use %MESSAGE.NAME% and %VARIABLE.NAME% in the same pattern for message mapping.
You cannot use %NVVARIABLE.NAME% and %ELEMENT.NAME% in the same pattern for NV data mapping.
Auto-mapping is accessed via the Mapping menu or – in the respective views – the Auto-Mapping context menu option or the Auto-Mapping button; see also Accessing ASCET Messages – step 6, Accessing Calibration Parameters – step 5, or Accessing Non-Volatile Variables – step 5.
See also
Accessing Calibration Parameters