I understand that you are concerned that having a type represent and ADT or an IDT may influence whether a definition is generated in “Rte_type.h”. Let me clarify that the generation of the definitions in “Rte_type.h” is independent of whether a given type represents an ADT or an IDT.
The type definition will be generated in “Rte_type.h” as long as the type is used in the model, “Rte_type.h” is set as HeaderFile, and the DataScope property is set to “Exported”.
For a top-down workflow in Simulink:
- For Application data types imported from ARXML, Simulink.AliasTypes are created in Simulink.
- For the case of Implementation types:
- If they are referencing a base type, Simulink.AliasTypes will be created in Simulink.
- For the specific case of the base type being an Integer type with non-standard word length, they will be represented as Simulink.NumericTypes.
- For all other cases, Implementation data types are imported as Simulink.NumericTypes.
Regarding how Simulink.AliasTypes are exported when generating code from Simulink, let me clarify the current behaviour:
- Simulink.AliasTypes that have been created upon import from ARXML will preserve their “DataTypeMappingSet”, which can be accessed through the API “<https://www.mathworks.com/help/autosar/ref/autosar.api.getautosarproperties.html autosar.api.getAUTOSARProperties> ”, as follows:
>> arProps = autosar.api.getAUTOSARProperties(modelName);
>> mappingSet = arProps.find('', "DataTypeMappingSet")
>> listADT = find(arProps,[],'ApplicationDataType')
>> listIDT = find(arProps,[],'ImplementationDataType')
- Please be aware that this API will allow you to view the IDTs and ADTs, but it does not allow to modify any of the mappings.
- Therefore, for a Simulink.AliasType that has been created on import, and that represents an ADT, Simulink will generate that type as an ADT in the ARXML when following a round-trip workflow. If the imported type represents an IDT, an IDT will be generated.
- Simulink.AliasTypes created directly in Simulink (bottom-up workflow) will always be interpreted as IDTs in the generated code. It is currently not possible to select whether a given Simulink.AliasTypes represents an IDT or an ADT.