AUTOSAR Blockset software supports AUTOSAR software component modeling for the AUTOSAR Adaptive Platform. To develop an AUTOSAR adaptive software component in Simulink®, create a Simulink model that represents the AUTOSAR adaptive software component. Initiate the model creation in one of these ways:
Import an existing AUTOSAR XML (ARXML) component description into the Simulink environment as a model. You import a component description by using the AUTOSAR ARXML importer.
Rework an existing Simulink model into a representation of the AUTOSAR adaptive software component.
Starting from an AUTOSAR Blockset model template, create a Simulink model.
After creating an initial model design, refine the algorithmic content.
This tutorial shows a sample model representation of an AUTOSAR adaptive software component.
Explore the model. It consists of a subsystem,
LaneGuidanceAlgorithm. The subsystem has six inports,
which represent required ports of the AUTOSAR adaptive software component:
rightCarInBlindSpot. Two outports represent provider
Set model configuration parameter System target file to
autosar_adaptive.tlc. That system target file
setting enables use of AUTOSAR Blockset software and affects other model configuration parameter settings.
Language is set to
Generate code only is selected.
Toolchain is set to
Code interface packaging is set to
At the top level of the model, set up event-based communication. An AUTOSAR adaptive software component provides and consumes services. Each component contains:
An algorithm that performs tasks in response to received events
Required and provided ports, each associated with a service interface
Service interfaces, with associated events and associated namespaces
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.
To expedite the block insertion, you can copy the event blocks from the
completed version of the example model
Explore the model configuration. Solver settings are:
Type is set to
Solver is set to
Fixed-step size (fundamental sample time) is set
Periodic same time constraint is set to
In the Simulink Editor, you can enable sample time color-code by selecting the Debug tab and selecting Diagnostics > Information Overlays > Colors. A sample time legend shows the implicit rate grouping. The legend for this model shows that the model uses a single rate of 0.1 second. The model simulates in single-tasking mode.
Save the model to a writable folder on your current MATLAB® search path. Name the file
Next, configure elements of the AUTOSAR adaptive software component for use in the Simulink modeling environment.