Export Composition and Component ARXML Descriptions from AUTOSAR Blockset Architectures
If you have Simulink® Coder™ and Embedded Coder® licenses, from an AUTOSAR Blockset architecture model, you can:
Export composition and component AUTOSAR XML (ARXML) descriptions and generate component code.
Create a ZIP file to package build artifacts from the model hierarchy for relocation and integration.
Export an ECU configuration from an AUTOSAR Classic Platform architecture model as an extract that maps the software components in a composition to an AUTOSAR ECU. For more information, see Export AUTOSAR Architecture ECU Extract.
Export composition ARXML descriptions and generate ASAP2 (
.a2l
) files. For more information, see Generate ASAP2 File for AUTOSAR Architecture Models.
You can export an entire architecture model, a nested composition, or a single component. If you initiate an export that includes a composition, the export includes XML descriptions of the composition, component prototypes, and composition ports and connectors.
In this example, you will:
Configure the XML options of an AUTOSAR Blockset architecture model.
Export ARXML descriptions from an AUTOSAR Blockset architecture model while generating a descriptive report of the exported files
Configure Composition XML Options
To prepare for exporting ARXML files, examine and modify your XML options. XML options specified at the architecture model level are inherited during export by each component in the model.
To view XML options:
Open an AUTOSAR architecture model.
In this example, open the example model
autosar_tpc_composition
.openExample("autosar_tpc_composition");
From the Modeling tab, in the Share section, select XML Options. The XML Options dialog box opens.
This dialog box shows XML options for the classic architecture model. Modifications you make to these options are inherited by every component in the hierarchy.
The System Package option applies only to the composition level. If you export an ECU extract for a composition in an AUTOSAR Classic architecture model, System Package specifies the system package path to generate in the composition ARXML. For more information, see Export AUTOSAR Architecture ECU Extract.
XML option Exported XML File Packaging is supported for exporting architecture models. (since R2023a)
Setting the Exported XML File Packaging option allows you to
specify the granularity of XML file packaging for AUTOSAR elements created in Simulink.
Selecting Single file
exports the ARXML into a single file.
Selecting Modular
exports the ARXML into multiple files,
named according to the type of information contained in the file.
For more information about each XML option for Classic Platform architecture models, see:
Configure AUTOSAR XML Options for Classic Platform architecture models.
Configure AUTOSAR Adaptive XML Options for Adaptive Platform architecture models.
Export AUTOSAR Classic Platform Architecture and Generate an Architecture Export Report
In this example you will export ARXML files and generate an architecture export report for an AUTOSAR Blockset Classic Platform architecture model.
If not already open, open the example model
autosar_tpc_composition
.openExample("autosar_tpc_composition");
To export the architecture model, on the Modeling tab, in the Share section, select Share > Generate Code and ARXML.
In the Export Composition dialog box:
Specify the name of the ZIP file to package the generated code into
TPC_Composition.zip
.Select Open report so that the architecture export report opens when the export completes.
Click OK.
ARXML files are exported for any existing compositions in the architecture model and any linked architectural data. The architecture export report opens.
Generated code and ARXML files for referenced component models are not included in the report.
Alternatively, to programmatically export and generate packaged ARXML files for an
AUTOSAR Blockset architecture model use the export
function.
openExample("autosar_tpc_composition"); archModel = autosar.arch.loadModel("autosar_tpc_composition"); export(archModel,PackageCodeAndARXML="myArchModel.zip",OpenReport="on");
Note
When exporting an architecture model, the AUTOSAR schema versions of the architecture model and any component models in the hierarchy must match.
Generated Files and Architecture Export Report
After exporting ARXML files with the Open report option enabled, you can explore the exported ARXML files by using the architecture export report. The architecture export report details generated ARXML files for any compositions in the architecture model and architectural data in any linked data dictionaries.
Generated code for architectural data includes three ARXML files:
tpc_interfaces_datatype.arxml
— data types stored in the Architectural Data section of linked data dictionary,tpc_interfaces.sldd
.tpc_interfaces_external_interface.arxml
— interfaces stored in the Design Data section of linked data dictionary,tpc_interfaces.sldd
.tpc_interfaces_interface.arxml
— interfaces stored in the Architectural Data section of linked data dictionary,tpc_interfaces.sldd
.
For more information regarding storing AUTOSAR architectural data in data dictionaries, see Graphically Manage AUTOSAR Architectural Data.
When the architecture is exported, the current folder contains build folders for the
architecture model, each component model in the hierarchy, and the specified ZIP file,
TPC_Composition.zip
.
Expand TPC_Composition.zip
. Its contents include the folders
arxml
and src
. Examine the
arxml
folder. The files in this folder include the ARXML files
that are displayed in the architecture export report.
Each AUTOSAR component has component and implementation description files, while the architecture model has composition, data type, interface, and timing description files. The composition file includes XML descriptions of the composition, component prototypes, composition ports, and composition connectors. The data type and interface files aggregate elements from the entire architecture model hierarchy.
Note
Timing files are not generated for referenced compositions within the architecture model hierarchy.
In the src
folder, each component model has a build folder that
contains artifacts from a standalone model build.
To export a nested composition or a single component in an architecture model, use composition or component block cues or context menu options, which you can access by right-clicking a component or composition block. For example, right-click a component block and select Export Component. Components exported from an architecture model inherit the XML options specified at the architecture model level.
Note
When exporting an architecture model, the AUTOSAR schema versions of the architecture model and any component models in the hierarchy must match.
To generate code generation reports for exported component models in an AUTOSAR architecture, ensure that the Create code generation report (Simulink Coder) configuration parameter is enabled in the component model before exporting it.
For information regarding generating reports using Simulink Report Generator™, see Generate System Architecture Reports with System Composer Report API for Software Architectures (System Composer).
See Also
Software Composition | Classic Component | export
Topics
- Author AUTOSAR Compositions and Components in Architecture Model
- Configure AUTOSAR XML Options
- Generate AUTOSAR C Code and XML Descriptions
- Generate ASAP2 File for AUTOSAR Architecture Models
- Configure AUTOSAR Architecture Model Programmatically
- Generate System Architecture Reports with System Composer Report API for Software Architectures (System Composer)