Svashasan Logo
Simulated data

Simulation, Testing and Validation · X-in-the-loop testing

Software-in-the-LoopSIL

Also known as SIL simulation, host-based testing

IntermediateSource-checked · awaiting technical reviewLast reviewed 6 December 2026

A test method in which production source code, hand-written or generated, is compiled and executed on a development computer against simulated inputs or a plant model, to verify software behaviour before target hardware is used.

Explanation

In MathWorks' definition, a SIL simulation compiles the generated code and runs it on the development computer as a separate process. Its purposes are to show numerical equivalence between the model and the code, to measure code coverage and to profile execution. Processor-in-the-loop (PIL) is the next step: the code is cross-compiled and the object code runs on the target processor or an instruction-set simulator.

In ADAS and automated driving the term is used more broadly for running a complete software stack, such as Autoware, against a driving simulator on a workstation or in the cloud, often at scale in continuous integration. Note the acronym clash: in functional safety, SIL also means Safety Integrity Level (IEC 61508), which is unrelated.

SIL cannot reveal problems that depend on the target: the host compiler and processor architecture differ from the target's, memory limits and target-specific optimisations are not represented, and execution is not in real time, so timing behaviour is not verified. These need PIL, HIL or on-target testing.

How it works

The software under test is built for the host computer and wrapped so that a test harness or simulator can provide inputs and read outputs. Stimuli come from test vectors, recorded data or simulated scenarios. Outputs are compared with expected results or with the model's outputs in a back-to-back test, coverage is collected through instrumentation, and runs are automated so they execute on every change.

Automotive applications

  • Back-to-back testing of generated code against the model
  • Continuous-integration regression testing
  • Code coverage measurement
  • Running ADAS software stacks against driving simulators

Example

After regenerating C code for a lane-keeping controller, a SIL run executes the code on the build server with the same test vectors used in model simulation. Outputs must match the model within tolerance, and statement and branch coverage are recorded for the verification report.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. SIL and PIL Simulations (opens in a new tab)

    MathWorks (Embedded Coder documentation) · Manufacturer documentation · SIL and PIL definitions and purposes · retrieved 6 December 2026

    “A SIL simulation compiles and runs the generated code on your development computer.”
  2. What are MIL, SIL, PIL, and HIL, and how do they integrate with the Model-Based Design approach? (opens in a new tab)

    MathWorks (MATLAB Answers, MathWorks Support Team) · Manufacturer documentation · Accepted answer by MathWorks Support Team · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.