Main Content

Create AUTOSAR Adaptive Software Component Model

R2026b

Create AUTOSAR Adaptive software component models in Simulink® by using one of these methods:

In this tutorial, you create model my_autosar_LaneGuidance from Simulink model LaneGuidance.

Top level view of LaneGuidance.

For your reference, you can open example model autosar_LaneGuidance to check your work and explore a configured AUTOSAR Adaptive software component model.

  1. Open example model LaneGuidance:

    openExample("LaneGuidance");

  2. Set configuration parameter System target file to autosar_adaptive.tlc. This system target file enables AUTOSAR Blockset software and sets these configuration parameters in the model:

    Configuration ParameterValue
    Language C++
    Toolchain AUTOSAR Adaptive | CMake
    Code replacement library C++ Standard Library Mutex
    Array container type std::array
    AUTOSAR schema version R22-11
    Maximum short name length 128
  3. Verify the solver settings, which determine the execution period of the generated code. The fixed-step size directly controls the periodic task rate in the main.cpp file that is generated in the last step of this tutorial.

    Configuration ParameterValue
    Type Fixed-step
    Solver auto (Automatic solver selection)
    Fixed-step size 0.2
    Periodic same time constraint Unconstrained
  4. Examine the bus element ports that model event-based data communication in the model. The model consists of a subsystem, LaneGuidanceAlgorithm, with In Bus Element and Out Bus Element blocks.

    PortElements
    LeftSensor
    • LaneDistance

    • TurnIndicator

    • CarInBlindSpot

    RightSensor
    • LaneDistance

    • TurnIndicator

    • CarInBlindSpot

    HazardIndicator
    • Left

    • Right

  5. Save the model to a writable folder on your current MATLAB® search path. Name the file my_autosar_LaneGuidance.slx.

Next, see Configure AUTOSAR Adaptive Software Component Ports and Interfaces.

See Also

Topics