Optional: Generate and Package Composition ARXML and Component Code (Requires Embedded Coder)
If you have access to Simulink® Coder™ and Embedded Coder® software, you can export composition and component AUTOSAR XML (ARXML) files and generate component code from an AUTOSAR architecture model. Optionally, you can create a ZIP file to package build artifacts for the model hierarchy, for example, for relocation to a testing or integration environment.
Open the architecture model constructed in this tutorial or open example model
autosar_tpc_composition
using the following command.openExample('autosar_tpc_composition')
Optionally, to prepare for exporting ARXML, you can examine and modify XML options. On the Modeling tab, select Export > Configure XML Options. XML options specified at the architecture model level are inherited during export by each component in the model. For information regarding these settings see AUTOSAR XML Options Settings.
To generate and package code for the throttle position control application, on the Modeling tab, select Export > Generate Code and ARXML. In the Export Composition dialog box, specify the name of the ZIP file in which to package the generated files. This example uses folder name
MyTPC_Composition
. To begin the export, click OK.As the architecture model builds, you can view the build log in the Diagnostic Viewer. First the component models build, each as a standalone top-model build. Finally, composition ARXML is exported. When the build is complete, a hierarchy of folders is created. for the architecture model and each component model in the hierarchy, and the specified ZIP file.
Expand the ZIP file. Its content is organized in
arxml
andsrc
folders.Examine the
arxml
folder. 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, and composition ports and connectors. The datatype, interface, and timing files aggregate elements from the entire architecture model hierarchy.Examine the
src
folder. Each component model has a build folder that contains artifacts from a standalone model build.