Main Content

Configure AUTOSAR Scheduling and Simulation

To configure scheduling and simulation for an AUTOSAR architecture model, you can:

  • Add Basic Software (BSW) blocks to simulate calls to BSW services.

  • Create a test harness model to connect inputs and plant elements to the architecture model.

  • Use the Schedule Editor to schedule and specify the execution order of component runnables.

To simulate the behavior of the aggregated components in an open architecture model, click Run.

Simulate Basic Software Service Calls

For the AUTOSAR Classic Platform, AUTOSAR Blockset provides Basic Software (BSW) blocks, which allow you to model software component calls to BSW services that run in the AUTOSAR run-time environment. BSW services include NVRAM Manager (NvM), Diagnostic Event Manager (Dem), and Function Inhibition Manager (FiM). In the run-time environment, AUTOSAR software components typically access BSW services using client-server or sender-receiver communication.

To simulate AUTOSAR components that call BSW services, you create a containing architecture, composition, or test harness model and add preconfigured BSW service component blocks. The blocks provide reference implementations of BSW service operations.

If the components in your architecture model use BSW caller blocks, make sure that the architecture model contains BSW service implementations. For more information, see Model AUTOSAR Basic Software Service Calls and Simulate AUTOSAR Basic Software Services and Run-Time Environment.

For an example of using BSW blocks in an AUTOSAR architecture model, see Author AUTOSAR Compositions and Components in Architecture Model.

Connect a Test Harness

After you develop an architecture model, you can connect it to a test harness model that provides meaningful input values and plant model elements. For example, consider the architecture model autosar_tpc_composition from example Author AUTOSAR Compositions and Components in Architecture Model. The model has three require (input) ports and one provide (output) port.

Here is a test harness model for simulating the architecture model autosar_tpc_composition. The test harness contains a plant model with a pedal input block and signals that correspond with the architecture model require and provide ports. This model was adapted from example model autosar_tpc_system.

To connect the architecture model to the test harness:

  1. Insert a Model block.

  2. Configure the Model block to reference the architecture model.

  3. In the Model block dialog box, select the option Schedule rates. For the associated parameter Schedule rates with, select Schedule Editor. The architecture model components have explicit partitions that you can schedule with the Schedule Editor.

  4. Connect the architecture model ports to the test harness signals.

To view and run the completed test harness model, open example model autosar_tpc_system. (To open the model in a local working folder, use openExample('autosar_tpc_system').)

Schedule Component Runnables

To schedule and specify the execution order of AUTOSAR component runnables, use the Schedule Editor. In the Schedule Editor, you can:

  • View a graphical representation of runnables as partitions in an AUTOSAR component.

  • Create partitions and map them to AUTOSAR runnables.

  • Directly specify the execution order of runnables.

You can open the Schedule Editor from a standalone component model or an architecture model.

In a standalone AUTOSAR component model, to open the Schedule Editor, open the Modeling tab and select Schedule Editor. For the runnables in the component model, the Schedule Editor initially displays implicit partitions, created based on the component modeling style. You can view and configure the implicit partitions or create explicit partitions and map them to new or existing AUTOSAR runnables.

Use the Schedule Editor controls to modify the execution order of the runnables. For example, in the Order section, click directional arrows or drag table entries. For more information, see Configure AUTOSAR Runnable Execution Order.

In an AUTOSAR architecture model, to open the Schedule Editor, open the Modeling tab and select Design Tools > Schedule Editor. The editor displays partitions representing every component runnable in the composition hierarchy. Here is the execution order view when you open the Schedule Editor from the example architecture model autosar_tpc_composition. Use the editor controls to modify the execution order of the runnables.

For more information, see Using the Schedule Editor and Create Partitions.

See Also

| |

Related Topics