Main Content

Configure AUTOSAR Basic Software Service Implementations for Simulation

AUTOSAR Blockset provides reference implementations of Diagnostic Event Manager (Dem), Function Inhibition Manager (FiM), and NVRAM Manager (NvM) services supported by AUTOSAR Basic Software (BSW) caller blocks. When coupled with the BSW caller blocks, the reference implementations allow you to configure and run system- or composition-level simulations of AUTOSAR BSW service calls. The ability to simulate calls into BSW services can help identify modeling problems before the AUTOSAR generated code reaches the AUTOSAR Runtime Environment (RTE).

To configure BSW caller blocks and BSW service reference implementations for simulation:

  1. In one or more AUTOSAR component models, configure calls to AUTOSAR BSW services. Follow the procedures described in Configure Calls to AUTOSAR Diagnostic Event Manager Service, Configure Calls to AUTOSAR Function Inhibition Manager Service, or Configure Calls to AUTOSAR NVRAM Manager Service.

  2. For simulation purposes, create a composition, system, or harness model that contains instances of the AUTOSAR component models. This procedure uses AUTOSAR example model autosar_bsw_presim, which is used in example Simulate AUTOSAR Basic Software Services and Run-Time Environment. The referenced component models call NvM service operation ReadBlock and Dem service operations SetEventStatus and GetEventFailed.

    Alternatively, as shown in the next step, you can use Simulink® Test™ to create a harness model.

  3. In the containing model, provide reference implementations of the Dem or NvM service operations that your AUTOSAR component models call. For Dem and NvM service operations, the AUTOSAR Basic Software block library provides Diagnostic Service Component and NVRAM Service Component blocks.

    You can insert a Service Component block in either of two ways:

    • Automatically insert the block by creating a Simulink Test harness model. In an AUTOSAR component model or a containing model, on the Apps tab, click Simulink Test. Then, on the Tests tab, click Add Test Harness. In the Create Test Harness dialog box, click OK. The software compiles the model, adds a Diagnostic or NVRAM Service Component block, and creates ports and other elements required for simulation. For example, here is a test harness created for the presimulation integration model in example Simulate AUTOSAR Basic Software Services and Run-Time Environment.

    • Manually insert the block into a containing composition, system, or harness model. Using the Library Browser or add_block command, or by typing block names in the model window, add a service component block to the containing model. Example Simulate AUTOSAR Basic Software Services and Run-Time Environment uses these commands to add Diagnostic Service Component and NVRAM Service Component blocks to a containing model and then update the model diagram.

      add_block('autosarlibdem/Diagnostic Service Component',...
        'autosar_bsw_presim/Diagnostic Service Component');
      add_block('autosarlibnvm/NVRAM Service Component',...
        'autosar_bsw_presim/NVRAM Service Component');
      set_param('autosar_bsw_presim','SimulationCommand','update');

  4. Each service component block has prepopulated parameters. Examine the parameter settings and consider if modifications are required, based on how you are using the Dem, FiM, and NvM service operations. For more information, see Diagnostic Service Component and NVRAM Service Component.

  5. Simulate the containing model. The simulation exercises the AUTOSAR Dem and NvM service calls in the component models. For a sample simulation, see example Simulate AUTOSAR Basic Software Services and Run-Time Environment.

See Also

|

Related Examples

More About