Main Content

Verify AUTOSAR C Code with SIL and PIL

As part of developing AUTOSAR software for the Classic Platform, you can carry out code verification of AUTOSAR software components by using software-in-the-loop (SIL) and processor-in-the-loop (PIL) simulations. Use SIL for verification of generated source code on your development computer, and PIL for verification of object code on your production target hardware.

Through behavioral and structural comparisons, code verification demonstrates the equivalence between a component model and its generated code. You can:

  • 组件测试数值之间的等价性model and generated code by comparing normal mode simulation results against SIL or PIL simulation results.

  • Show the absence of unintended functionality by comparing model coverage against code coverage or performing a traceability analysis.

    • Configure SIL and PIL simulations to generate code coverage metrics.

    • Generate reports that provide bidirectional traceability between model objects and generated code.

With AUTOSAR models, you run SIL and PIL testing by configuring either the top model or Model blocks.

  • For unit-level testing of an AUTOSAR software component, use top model SIL or PIL. You can test a top model that is configured for the AUTOSAR system target file (autosar.tlc) by setting the simulation mode toSoftware-in-the-Loop (SIL)orProcessor-in-the-Loop (PIL).

  • For unit-level testing of a subcomponent referenced from an AUTOSAR software component, use Model block SIL or PIL. In the Model block for the submodel, setSimulation modeto SIL or PIL and setCode interfacetoModel reference.

  • For composition-level testing of multiple AUTOSAR software components, reference the component models in a composition, architecture, or test harness model. In the Model block for each component under test, setSimulation modeto SIL or PIL and setCode interfacetoTop model.

For more information, seeSimulation with Top Model(Embedded Coder)andSimulation with Model Blocks(Embedded Coder).

If you have金宝app®Test™software, you can use test harnesses to:

Related Examples

More About