Main Content

AUTOSAR的基本配置Software Service Implementations for Simulation

AUTOSAR Blockset提供参考实现s 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 inConfigure Calls to AUTOSAR Diagnostic Event Manager Service,Configure Calls to AUTOSAR Function Inhibition Manager Service, orConfigure 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 modelautosar_bsw_presim, which is used in exampleSimulate AUTOSAR Basic Software Services and Run-Time Environment. The referenced component models call NvM service operationReadBlockand Dem service operationsSetEventStatusandGetEventFailed.

    Alternatively, as shown in the next step, you can use万博1manbetx®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 providesDiagnostic Service ComponentandNVRAM Service Componentblocks.

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

    • Automatically insert the block by creating aSimulink Testharness model. In an AUTOSAR component model or a containing model, on theAppstab, clickSimulink Test. Then, on theTeststab, clickAdd Test Harness. In the Create Test Harness dialog box, clickOK. 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 exampleSimulate AUTOSAR Basic Software Services and Run-Time Environment.

    • Manually insert the block into a containing composition, system, or harness model. Using the Library Browser oradd_blockcommand, or by typing block names in the model window, add a service component block to the containing model. ExampleSimulate AUTOSAR Basic Software Services and Run-Time Environment使用这些命令来添加Diagnostic Service ComponentandNVRAM Service Componentblocks 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, seeDiagnostic Service ComponentandNVRAM 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 exampleSimulate AUTOSAR Basic Software Services and Run-Time Environment.

See Also

|

Related Examples

More About