Main Content

Configure and Export ARXML from AUTOSAR Classic Software Architectures

R2026b

If you have Simulink® Coder™, Embedded Coder®, and System Composer™, from an AUTOSAR software architecture model, you can:

  • Export composition and component AUTOSAR XML (ARXML) descriptions and generate component code.

  • For software architecture models configured for the AUTOSAR Adaptive Platform you can generate service implementation code for integration with the AUTOSAR Runtime for Adaptive (ARA).

  • Create a ZIP file to package build artifacts from the model hierarchy for relocation and integration.

  • Export an ECU configuration from a software architecture model configured for the AUTOSAR Classic Platform 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 start 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 software architecture model.

  • Export ARXML descriptions from an AUTOSAR software architecture model and generate a descriptive report of the exported files.

Configure AUTOSAR Classic Composition XML Options

To prepare your software architecture for ARXML file export, examine and modify your XML options. XML options set for a software architecture model are inherited by each software component and composition in the software architecture.

To view XML options:

  1. Open an AUTOSAR architecture model.

    In this example, open the AUTOSAR Classic software architecture model autosar_tpc_composition.

    openExample("autosar_tpc_composition");

  2. 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 AUTOSAR Classic software architecture model. Modifications you make to the XML options are inherited by the software components and compositions included in the software architecture.

XML options for an AUTOSAR classic architecture model

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 the options available for configuring ARXML export, see:

Export AUTOSAR Classic Software Architecture and Generate Architecture Export Report

In this example you will export ARXML files and generate an architecture export report for an AUTOSAR software architecture configured for the AUTOSAR Classic Platform.

  1. If not already open, open example model autosar_tpc_composition.

    openExample("autosar_tpc_composition");

  2. To export the architecture model, on the Modeling tab, in the Share section, select Share > Generate Code and ARXML.

  3. 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.

    Export Composition dialog box.

    ARXML files are exported for compositions referenced by the architecture model and any linked data dictionaries. 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 component models in the hierarchy must match.

Inspect Exported ARXML 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.

Architecture export report for autosar_tpc_composition.

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 managing data for software architectures in data dictionaries, see Manage AUTOSAR Architectural Data With Data Dictionaries.

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. The files in the arxml 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. For more information about the scheduling information including in the generated timing ARXML file, see Configure AUTOSAR Classic Scheduling and Simulation.

Note

Timing files are not generated for referenced compositions within the architecture model hierarchy.

Contents of the arxml folder.

In the src folder, each component in the architecture contains artifacts from the export process.

Contents of the src folder.

To export a nested composition or a single component in an architecture model, use composition or component block cues. For example, select the Sensors composition in autosar_tpc_composition, and click the Export Composition cue.

Export Composition cue highlighted on Sensors Composition block.

To create code generation reports for exported component models in an AUTOSAR architecture, select configuration parameter Create code generation report (Simulink Coder) for the referenced software component models.

See Also

| |

Topics