Main Content

AUTOSAR Component Designer

R2026b

Generate AUTOSAR compliant C or C++ code and export ARXML descriptions for processors used in automotive systems

Description

Use the AUTOSAR Component Designer app to generate C or C++ code and ARXML descriptions from an AUTOSAR component model. When you open the app, an AUTOSAR tab is added to the toolstrip. The AUTOSAR tab represents groups of tasks in the AUTOSAR Blockset workflow. The AUTOSAR tab provides different options depending on if the opened model is configured for the AUTOSAR Classic Platform or for the AUTOSAR Adaptive Platform.

To configure models for the AUTOSAR Classic Platform, you set the output to AUTOSAR. For models configured for the AUTOSAR Classic Platform, the AUTOSAR tab provides this toolstrip.

To configure models for the AUTOSAR Adaptive Platform, you set the output to AUTOSAR Adaptive. For models configured for the AUTOSAR Adaptive Platform, the AUTOSAR tab provides this toolstrip.

Open the AUTOSAR Component Designer App

From the MATLAB® Toolstrip, on the Apps tab, under Code Generation, click the app icon.

Parameters

expand all

Assistance

Open Embedded Coder Quick Start to prepare the model for AUTOSAR code generation. The Quick Start chooses fundamental code generation settings based on your goals and application.

Design (only applicable for AUTOSAR Adaptive models)

Open the Interface Editor (System Composer) to define port interfaces and elements in the Architectural Data section of a linked data dictionary.

Open the Property Inspector to view and edit communication, execution, deployment, and AUOTSAR properties of port elements.

Prepare

Open the Code Generation Advisor to set objectives for code generation, or select Edit-Time Checks to run available checks on the model. For more information, see Application Objectives Using Code Generation Advisor (Embedded Coder).

Open the model configuration parameters, or select C/C++ Code generation settings or Hardware Implementation from the drop-down menu to open configuration parameters in the Code Generation pane or Hardware pane, respectively.

Click Individual Element Code Mappings to open the Code Mappings Editor. Use the Code Mappings Editor to map model entry-point functions, data, and other elements to AUTOSAR elements and properties that are defined in the AUTOSAR standard. Click AUTOSAR Dictionary to open options for customizing exported ARXML files and generated code from an AUTOSAR perspective. For more information, see Configure AUTOSAR Elements and Properties.

Open the Service Mappings Editor, to configure communication and execution service properties, configure services for measurement and calibration, and configure services for parameters. For more information about service configurations for AUTOSAR Adaptive models, see these topics Model AUTOSAR Adaptive Service Communication and Execution Behavior, Model AUTOSAR Adaptive Persistent Memory, and Configure AUTOSAR Adaptive Software Component Service Mappings.

Open the AUTOSAR Dictionary to configure AUTOSAR elements from an AUTOSAR component perspective by using the AUTOSAR Dictionary. For more information about configure AUTOSAR Adaptive elements and XML options, see these topics Configure AUTOSAR Adaptive XML Options and Configure AUTOSAR Adaptive Service Interface Properties.

Generate Code

For AUTOSAR Classic Platform models, generate AUTOSAR C code and ARXML descriptions for testing or integration.

For AUTOSAR Adaptive Platform models, generate AUTOSAR C++ algorithm code, service implementation code, and ARXML descriptions for testing or integration. Click Build to build the model as a standalone executable application (requires a Linux® environment).

Results

Open the Code view to view the generated code alongside your model. In the Code view, you can trace between model elements and the code by clicking hyperlinked lines of code. To remove traceability highlighting, click Remove Highlighting.

If a code generation report exists, then clicking Open Report opens the code generation report. If no code generation report exists then clicking Open Report creates and opens the code generation report. Clicking Report Options opens the model Configuration Parameters dialog box to the Report pane.

Share

Options for sharing generated code with third parties, as well as generating additional files for calibration and measure testing.

  • Create Protected Model — Create a protected model to share with a third party for simulation and code generation.

  • Generate Simulink Real-Time Model and Test Harness (AUTOSAR Classic Platform only) — Create a Simulink® test harness for rapid control prototyping and hardware-in-the-loop testing workflows.

  • Generate Calibration Files — Generate ASAP2 (a2l) descriptions or Calibration Data Format (cdfx) files.

  • Generate Code and Package — Package the model code and build artifacts in a ZIP file, for example, for relocation and integration.

Tips

  • To generate code for a model in a modeling hierarchy, open the AUTOSAR Component Designer app in the Simulink Editor window from the top model for which you want to generate code. On the AUTOSAR tab, the functionalities apply to the top model of the hierarchy that is open in the editor.

  • To configure and view code for a referenced model, navigate to the model in the hierarchy and use the AUTOSAR Dictionary, Code Mappings editor (for AUTOSAR Classic models), Service Mappings editor (for AUTOSAR Adaptive models), and Code view. These views apply to the active model, which can be the top model or a referenced model.

Version History

Introduced in R2019b