Model AUTOSAR Adaptive Software Components
In Simulink®, you can flexibly model the structure and behavior of software components for the AUTOSAR Adaptive Platform.
The AUTOSAR Adaptive Platform defines a service-oriented architecture for automotive components that must flexibly adapt to external events and conditions. Compared to the AUTOSAR Classic Platform, the Adaptive Platform requires:
High-performance computing, potentially with multiple cores and heterogeneous processor types.
Fast communication, potentially with Ethernet or networks on chips.
Strong service-based interaction among components.
Ability to adapt running automotive applications to external events and information sources (potentially for highly automated driving), as well as external communication, monitoring, and live software updates.
An AUTOSAR adaptive system potentially contains multiple interconnected adaptive software components. You deploy adaptive software components in the run-time environment defined by the Adaptive Platform, AUTOSAR Runtime for Adaptive Applications (ARA).
An AUTOSAR adaptive software component provides and consumes services. The adaptive service architecture is flexible, scalable, and distributed. Services can be discovered dynamically and can run on local or remote Electronic Control Units (ECUs). Each software component contains:
An automotive algorithm, which performs tasks in response to received events.
Required and provided ports, each associated with a service interface, through which events are received and sent.
Service interfaces, which provide the framework for event-based communication, and their associated events and namespaces.
To model an AUTOSAR adaptive software component in Simulink, you start with a model that contains an automotive algorithm. From that model, you generate an AUTOSAR Dictionary that defines service interfaces, and an AUTOSAR code perspective that maps Simulink model elements to AUTOSAR component elements. As you further develop and refine the adaptive component in Simulink, you can iteratively simulate and build the model.
When you complete the component implementation, you can combine the adaptive software component model with other component models in an application-level simulation container model. The end goal is to deploy the component as part of an application in the ARA environment.
Here is the high-level workflow for modeling software components based on the AUTOSAR Adaptive Platform.
Open a Simulink model that either is empty or contains a functional algorithm.
Using the Model Configuration Parameters dialog box, configure the model for adaptive AUTOSAR code generation. Set System target file to
Develop the model algorithmic content for use in an AUTOSAR adaptive software component. If the model is empty, construct or copy in an algorithm. Possible sources for algorithms include algorithmic elements in other Simulink models. Examples include subsystems, referenced models, MATLAB Function blocks, and C Caller blocks.
At the top level of the model, set up event-based communication.
After each root inport, add an Event Receive block, which converts an input event to a signal while preserving the signal values and data type.
Before each root outport, add an Event Send block, which converts an input signal to an event while preserving the signal values and data type.
Map the algorithm model to an AUTOSAR adaptive software component. For example, in the Apps tab, click AUTOSAR Component Designer. Because the model is unmapped, the AUTOSAR Component Quick Start opens.
Work through the quick-start procedure. Click Finish to map the model. The model opens in the AUTOSAR code perspective.
Using the AUTOSAR code perspective and the AUTOSAR Dictionary (or equivalent AUTOSAR map and property functions), further refine the AUTOSAR adaptive model configuration.
In the AUTOSAR code perspective, examine the mapping of Simulink inports and outports to AUTOSAR required and provided ports and events.
In the AUTOSAR Dictionary, examine the AUTOSAR properties for RequiredPorts, ProvidedPorts, and Service Interfaces.
You can expand service interface nodes to examine their associated AUTOSAR events and define namespaces for interface C++ code.
Build the AUTOSAR adaptive software component model. Building the model generates:
C++ files that implement the model algorithms for the AUTOSAR Adaptive Platform and provide shared data type definitions.
AUTOSAR XML descriptions of the AUTOSAR adaptive software component and manifest information for application deployment and service configuration.
C++ files that implement a main program module.
AUTOSAR Runtime Adaptive (ARA) environment header files.
CMakeLists.txtfile that supports CMake generation of executables.
For more information, see Configure AUTOSAR Adaptive Software Components.
- Configure AUTOSAR Adaptive Software Components
- Create and Configure AUTOSAR Adaptive Software Component
- Map AUTOSAR Adaptive Elements for Code Generation
- Configure AUTOSAR Adaptive Elements and Properties
- Model AUTOSAR Adaptive Service Communication
- Configure AUTOSAR Adaptive Code Generation