Main Content

Model AUTOSAR Adaptive Software Components

R2026b

In Simulink®, you can model the structure and behavior of software components configured for the AUTOSAR Adaptive Platform. The AUTOSAR Adaptive Platform requires high-performance computation with multiple cores and heterogeneous processor types, and fast communication over Ethernet or network-on-chip interconnects. AUTOSAR Adaptive software components communicate through dynamically discovered services that can run locally or on remote Electronic Control Units (ECUs). At run time, AUTOSAR Adaptive software components must adapt to external events, including over-the-air updates and external monitoring.

When you model AUTOSAR Adaptive software components in Simulink, each AUTOSAR Adaptive software component model contains:

  • An algorithm that performs tasks in response to received events and method invocations

  • A software component service interface that defines the communication behavior, execution behavior, and services required by the software component independent of its model algorithm

  • Required and provided ports, through which the software component sends and receives events and invokes methods

  • AUTOSAR Adaptive Service Interfaces, which contain structural definitions of software component communication, including events, methods, and namespaces

AUTOSAR Adaptive Software Components in Simulink

A software component service interface defines software component communication and execution behavior, and the services required by the software component at run time. When you deploy software components as applications, the service interface becomes a service contract between the software component and its execution environment.

Design software component service interfaces by configuring these service properties in the Service Mappings Editor and Property Inspector:

  • Communication properties — Define communication service requirements for software component ports. For sender-receiver communication, configure queued or latest-value semantics, queue capacity, timeout, initial values, and status elements. For client-server communication, configure timeout, caller behavior, and status arguments.

  • Execution properties — Define when schedulable functions inside a software component execute. For sender-receiver communication, configure functions to execute when initialized, periodically, when a given port receives data, or when the application terminates. For client-server communication, configure the caller behavior of client method invocation as either synchronous or asynchronous.

  • Auxiliary properties — Define how software components interact with services for measurement and calibration in their execution environment. Configure measurement services to control which signals, states, and data stores are stored in nonvolatile memory as persistent data, or are measured or not measured by external tools at run time. Configure parameter tuning services to designate which parameters can be modified by external tools during execution. You configure these auxiliary properties on the Parameters and Measurements tabs in the Service Mappings Editor.

For more information, see Model AUTOSAR Adaptive Service Communication and Execution Behavior.

For example, in AUTOSAR Adaptive software component model autosar_LaneGuidance you can view communication properties for receiver ports in the Service Mappings Editor and configure communication and execution properties in the Property Inspector. The model automatically opens in the software component perspective, which provides an explicit boundary between the algorithmic content of the model and the ports of the software component for which you configure communication, execution, and auxiliary properties.

Property Inspector and Service Mappings Editor are open in autosar_LaneGuidance with software component port RightSensor selected.

To model an AUTOSAR Adaptive software component in Simulink:

  1. Open a Simulink model that is empty or contains a functional algorithm. If the model is empty, construct an algorithm or copy one into the model. Set configuration parameter System target file to autosar_adaptive.tlc.

    This walkthrough references example model autosar_LaneGuidance which you can open by entering this command in your MATLAB® Command Window:

    openExample("autosar_LaneGuidance");
  2. Refine existing model algorithmic content as necessary for your design.

  3. Set up service communication at the top level of the model by using bus element ports and function ports, and setting their service communication and execution properties.

  4. Configure the model as an AUTOSAR Adaptive software component by opening the AUTOSAR Component Designer app. Because the model is not already configured for an AUTOSAR target, the AUTOSAR Component Quick Start opens.

    Work through the quick-start procedure. Click Finish to configure the model as an AUTOSAR Adaptive software component. The model opens in the AUTOSAR software component perspective, providing an explicit software component boundary.

    Top level view of autosar_LaneGuidance in the AUTOSAR software component perspective. LeftSensor, RightSensor, HazardIndicator ports are visible on the software component boundary.

    For more information about modeling software component communication and execution in Simulink, see Model AUTOSAR Adaptive Service Communication and Execution Behavior.

  5. Refine your software component design by configuring service properties, AUTOSAR Adaptive Service Interfaces, port interfaces, and other AUTOSAR code generation properties by using the Service Mappings Editor, Property Inspector, data dictionaries, and AUTOSAR Dictionary. For more information, see Configure AUTOSAR Adaptive Service Interface Properties. For more information about configuring AUTOSAR Adaptive software components for code generation, see Configure AUTOSAR Adaptive Code Generation.

  6. Build the model to generate C++ code and export ARXML descriptions (requires Embedded Coder®). Building the model creates these code generation artifacts:

    • C++ files that implement the model algorithms compliant with the AUTOSAR Adaptive Platform and provide shared data type definitions

    • C++ files that implement a main program module and service communication

    • AUTOSAR Runtime for Adaptive (ARA) environment stub files

    • ARXML descriptions of the AUTOSAR Adaptive software component and compositions and manifest information for application deployment and service configurations

    • JSON deployment manifests that specify execution scheduling and service instance configuration compliant with the AUTOSAR Adaptive Platform

    • A CMakeLists.txt file that supports CMake generation of executables

    • An executable application that you can deploy to a POSIX-based target environment by using the Embedded Coder Support Package for Service-Oriented Applications on Linux®

  7. Verify generated C++ algorithm code by using top-model software-in-the-loop (SIL) simulations.

If you have Simulink Test™, you can validate AUTOSAR Adaptive software component service interfaces by using a test harness.

AUTOSAR Adaptive systems can contain multiple interconnected AUTOSAR Adaptive software components, each with its own service interface. In Simulink, you model AUTOSAR Adaptive systems with software architecture models (Requires System Composer™). AUTOSAR Adaptive software architecture models enable you to validate your service interface design during normal simulation. For more information about AUTOSAR Adaptive software architecture modeling, see Author AUTOSAR Adaptive Compositions with Software Architectures.

See Also

Topics