Main Content

Add and Connect AUTOSAR Adaptive Components and Compositions

After you create an AUTOSAR architecture model, develop the top-level AUTOSAR classic or adaptive software design. The composition editor provides a view of AUTOSAR software architecture based on the AUTOSAR Virtual Function Bus (VFB).

To begin, on the Simulink® Toolstrip Modeling tab, click Platform and select Adaptive Platform to configure adaptive architecture modeling. After that, you can use the composition editor and the Modeling tab to add and connect AUTOSAR software compositions and adaptive components.

Alternatively, you can import a software composition from ARXML files. See Import AUTOSAR Composition from ARXML.

Add and Connect Adaptive Component Blocks

To add and connect AUTOSAR adaptive software components in an architecture model:

  • Add components.

    From the Modeling tab or the palette to the left of the canvas, add an Adaptive Component block. By using the Property Inspector, you can inspect the block. The component Kind for adaptive architecture modeling is AdaptiveApplication.

  • Add component require ports and provide ports.

    To add each component port, click an edge of an Adaptive Component block. Port controls appear for modeling communication over the service interfaces.

    • For event communication, select Input for a require port or Output for a provide port.

    • For method communication, select Client for a require port or Server for a provide port.

    Require and provide port selection for the Adaptive Component.

  • Connect block ports.

    To connect the Adaptive Component blocks to other blocks, connect the block ports with signal lines. Connecting adaptive component blocks together represents the service oriented communication between the two communication endpoints.

    Connect the Server port of Component2 with the Client port of Component1 by using a signal line.

  • Connect root ports.

    To connect the Adaptive Component blocks to architecture or composition model root ports, drag lines from the component ports to the containing model boundary.

    Connecting the receive port of an adaptive software component to the root port.

    Releasing the connection creates a root port at the boundary.

    Client port of an adaptive software component connected to the root port.

  • Configure additional AUTOSAR properties by using the Property Inspector.

As an example, add and connect components for a client-server architecture model. The model consists of a sensor client component receiving raw data over a require port, filtering that data by using a method call to a filter service component, and sending the filtered data over a provider port.

  1. Using the Simulink Start Page, create an AUTOSAR architecture model. (For more information, see Create AUTOSAR Architecture Models.) The model canvas initially is empty.

  2. From the Modeling tab, click Platform and select Adaptive Platform.

  3. From the Modeling tab or the palette, add two Adaptive Component blocks. Label the first block Sensor and the second block Filter. Place the Filter component below the Sensor component.

  4. Add ports to the Sensor and Filter components.

    1. Add a Client port to the Sensor component and label it Filter_RPort.

    2. Add a Server port to the Filter component and label it Filter_PPort.

    3. Connect the two ports.

    4. Add an Input port to the Sensor component and label it Data_RPort.

    5. Add an Output port to the Sensor component and label it FilteredData_PPort. Resize the Sensor component as needed to fit the labels.

    The canvas shows two adaptive components, providing client-server method communication.

  5. Connect the Data_RPort and FilteredData_PPort ports to architecture model root ports. Drag a line from each port to the model boundary.

    Block ports and root ports connected for the three adaptive components.

The design is complete, but behavior is not yet defined for the AUTOSAR components.

The next step is to add Simulink behavior to the AUTOSAR components by creating, importing, or linking models. See Define AUTOSAR Component Behavior by Creating or Linking Models.

If you have Requirements Toolbox™ software, you can link components in an AUTOSAR architecture model to requirements. See Link AUTOSAR Components to Requirements.

Add and Connect Composition Blocks to an Adaptive Model

To add and connect an AUTOSAR software composition nested in an architecture model:

  • From the Modeling tab or the palette to the left of the canvas, add a Software Composition block.

  • Add composition require ports and provide ports. To add each composition port, click an edge of the Software Composition block. Port controls appear for modeling communication over the service interfaces.

    • For event communication, select Input for a require port or Output for a provide port.

    • For method communication, select Client for a require port or Server for a provide port.

    AUTOSAR Software Composition block with client, server, input, and output ports.

    Alternatively, open the Software Composition block. To add each composition port, click the boundary of the composition diagram. When port controls appear, select Input or Client for require ports, or Output or Server for provide ports as required for your interface.

  • To connect the Software Composition block to other blocks, connect the block ports with signal lines.

  • To connect the Software Composition block to architecture or composition model root ports, drag lines from the composition ports to the containing model boundary.

    Connecting the client port of an AUTOSAR Software Composition block with a root port.

    Releasing the connection creates a root port at the boundary.

  • Configure additional AUTOSAR properties by using the Property Inspector.

An AUTOSAR composition contains a set of AUTOSAR components and compositions with a shared purpose. To populate a composition, open the Software Composition block and begin adding more Adaptive Component and Software Composition blocks.

See Also

|

Related Topics