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:
Test numerical equivalence between your component 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 to
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, set Simulation mode to SIL or PIL and set Code interface to
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, set Simulation mode to SIL or PIL and set Code interface to
If you have Simulink® Test™ software, you can use test harnesses to:
Perform composition-level testing of AUTOSAR software components. For more information, see Testing AUTOSAR Compositions (Simulink Test).
Perform unit-level testing of atomic subsystems in AUTOSAR software components. For more information, see Unit Test Subsystem Code with SIL/PIL Manager (Embedded Coder).
- Simulation with Top Model (Embedded Coder)
- Simulation with Model Blocks (Embedded Coder)
- Testing AUTOSAR Compositions (Simulink Test)
- Unit Test Subsystem Code with SIL/PIL Manager (Embedded Coder)