Einführungsaktion

Until Dec 31 only: 25 % introductory discount for new customers

Noch
00Days
00Hrs
00Min
00Sec
Claim the deal
Magazin
·
Grundlagen

HiL vs. SiL vs. MiL: Which X-in-the-Loop method for which test?

Every test team is familiar with MiL, SiL, and HiL. However, it is often unclear which test belongs at which stage and how many tests are unnecessarily running on expensive HiL test benches. This comparison contrasts the X-in-the-Loop methods and provides a decision matrix for your test planning.

HiL vs. SiL vs. MiL: Which X-in-the-Loop method for which test?

At a glance:

  • MiL tests functional logic in the model, SiL tests production code virtually, and HiL tests one or more real electronic control units (ECUs) against a real-time simulation.
  • Realism typically increases from MiL to SiL to HiL, while scalability and parallelization decrease. Costs depend primarily on the simulation effort, not just the stage.
  • SiL tests run in parallel in the cloud and fit into CI/CD pipelines, whereas HiL tests run serially on the test bench.
  • The best test strategy distributes the bulk of test cases across MiL and SiL, reserving HiL for hardware-related verification.
  • Up to 75% of all errors can be found purely virtually before a test ever reaches the HiL test bench.

Every test team is familiar with MiL, SiL, and HiL. The real question is: which test belongs at which stage—and how many tests are running on the expensive HiL test bench even though they don't belong there? This comparison contrasts the X-in-the-Loop methods based on clear criteria and provides a decision matrix for your test planning.

The difference between MiL, SiL, and HiL lies in what is real and what is simulated: Model-in-the-Loop (MiL) tests the functional model, Software-in-the-Loop (SiL) tests the production code without special embedded hardware, and Hardware-in-the-Loop (HiL) tests the actual ECU. With each stage, realism typically increases, while scalability and parallelizability decrease. Costs depend primarily on the simulation effort.

‍

The XiL stages differ in what is real

X-in-the-Loop (XiL) is the umbrella term for test methods where part of the system is real and the rest is simulated. The "X" stands for the device under test: a model, software, a processor, or a complete ECU. As development progresses, more real components are added to the control loop. The control loop does not always have to be closed: in open-loop approaches, such as the re-simulation of recorded camera data, the device under test is supplied with data without its reaction affecting the simulation. The industry is therefore increasingly speaking of simulation in general rather than individual In-the-Loop stages, although no new established terms exist yet.

Definition
X-in-the-Loop (XiL) refers to the family of test methods including Model-in-the-Loop, Software-in-the-Loop, Processor-in-the-Loop, Hardware-in-the-Loop, and Vehicle-in-the-Loop, in which a device under test is tested in a closed control loop with a simulated environment.

The stages at a glance:

  • Model-in-the-Loop (MiL): The functional model, e.g., in MATLAB/Simulink, runs against an environment model. This tests the concept, not the code.
  • Software-in-the-Loop (SiL): The generated or handwritten production code runs on a PC or in the cloud. This tests the software without dedicated embedded hardware, simulated on standard computer hardware.
  • Processor-in-the-Loop (PiL): The code runs on the target processor or an evaluation board. This tests compiler effects and runtime behavior.
  • Hardware-in-the-Loop (HiL): One or more complete electronic control units (ECUs) are electrically connected to a real-time simulator. We explain the setup and limitations in our article on Hardware-in-the-Loop (HiL).
  • Vehicle-in-the-Loop (ViL): The real vehicle is driven, for example on a test track, within a simulated environment featuring virtual road users. This tests driving functions across the entire vehicle.

‍

MiL, SiL, and HiL in direct comparison

The methods differ not only technically but, above all, in terms of cost, speed, and scalability. The following table compares the three main stages based on the criteria that are decisive for test planning.

Criterion Model-in-the-Loop (MiL) Software-in-the-Loop (SiL) Hardware-in-the-Loop (HiL)
Device under testFunctional modelProduction codeReal ECU
Special embedded hardware requirednonoyes, test bench
realismlowmediumhigh
project stagevery earlyearlylate, as soon as hardware is available
executionnon-real-timenon-real-time (faster or slower depending on the model), parallelreal-time, serial
scalingunlimitedunlimited, cloudlimited by number of test benches
infrastructure costs per test runvery lowlowhigh
CI/CD capabilityhighhighlimited
Typically findsLogic and concept errorsCode, integration, and protocol errorsElectrical, real-time, and bus design errors

‍

The table shows the basic pattern: each stage typically finds a different class of error, and none completely replaces the others.

One cost factor is missing from every such table: the effort required for the simulation itself. This does not depend on the stage. A MiL or SiL can require significantly more complex simulations than a HiL, and vice versa. Some simulation aspects are simply too much for a SiL because the effort and benefit are out of proportion. Therefore, where a test is run is also decided by which simulation is necessary for it and whether it already exists. The more stage-independent simulations are set up, the better they can be reused across MiL, SiL, and HiL.

Tip: Software-in-the-Loop (SiL) is particularly well-suited for finding integration errors and bugs in protocol implementation early on, because SiL tests do not require special embedded hardware and can be executed in parallel.

Every test question belongs to exactly one stage

The right stage is determined by the test question, not by habit. Many teams send tests to the HiL test bench simply because it is available—even though the test question does not require actual hardware.

Testfrage Passende Stufe Warum
Funktioniert die Regelstrategie grundsätzlich?MiLLogik lässt sich im Modell prüfen, bevor Code existiert
Verhält sich der Seriencode wie das Modell?SiL (Back-to-Back-Test)Vergleich Modell gegen Code ohne Hardware
Laufen alle Varianten nach einem Commit fehlerfrei?SiL in der CI/CD-PipelineRegression braucht Tempo und Parallelisierung, gilt für nicht hardwarerelevante Funktionen
Ist die Kommunikation der Steuergeräte protokollkonform implementiert?SiL mit virtuellen SteuergerätenProtokoll-Implementierung lässt sich im virtuellen Verbund prüfen, Busauslegung und Timing noch nicht
Stimmen Busauslegung und Timing im realen Verbund?HiLPhysikalisches Busverhalten und Echtzeit brauchen reale Steuergeräte
Stimmt das Laufzeitverhalten auf dem Zielprozessor?PiLCompiler- und Timing-Effekte des Prozessors
Reagiert das Steuergerät korrekt auf Kabelbruch oder Kurzschluss?HiLElektrische Fehler brauchen echte Hardware
Ist der Softwarestand bereit für die Freigabe?HiLFinaler hardwarenaher Nachweis

‍

A large portion of the test questions in this matrix can be answered without special embedded hardware. This is exactly where the potential lies: do not eliminate HiL, but relieve HiL of everything it does not need. Virtual ECUs (vECUs) are a prerequisite for virtual integration testing.

30 Minuten, ein Experte, eine ehrliche Einschätzung
Wir schauen gemeinsam auf Ihren Testablauf und zeigen, welcher Anteil sich heute virtualisieren ließe.
Check buchen

Frontloading reduces costs and shortens test cycles

Frontloading means shifting tests to virtual stages as early as possible. The reason is economic. Errors found early in the development process cost a fraction of later corrections—and every error that SiL finds no longer blocks a HiL slot.

Our "Passenger Car Exterior Lighting System" test scenario with 15 ECUs and over 1,800 test combinations per release demonstrates the impact:

  • Serial on HiL: more than 210 hours of pure test time, one test after another.
  • Parallel with violis: 100 tests simultaneously, 2.1 hours total runtime, results overnight.
  • Total test cycle: typically six weeks on the HiL test bench, under 14 days with the violis platform.
Definition
In ECU validation, frontloading refers to the shifting of test cases from late, hardware-dependent stages like Hardware-in-the-Loop to early, virtual stages like Model-in-the-Loop and Software-in-the-Loop.

From HiL to SiL: Using test cases and simulations across stages

The greatest effort in frontloading is not the technology, but the duplicate test maintenance. If SiL and HiL tests are created in separate tools and formats, the team maintains two separate testing worlds. The solution is a platform that connects both worlds.

violis connects existing tools such as Vector CANoe4SW, dSPACE VEOS, Synopsys Silver, tracetronic ecu.test, pytest, and MATLAB/Simulink via standardized interfaces. Virtual and physical test worlds are connected, and results are consolidated centrally. In our experience, many existing HiL test cases can be reused instead of being rewritten for SiL. The same applies to simulations: this is precisely where a synergy exists that is often not leveraged today. Those who set up environment and residual bus models across stages can use them equally in MiL, SiL, and HiL.

This is what a typical migration looks like:

  1. Classify test cases: Which HiL tests check hardware behavior, and which only check functional logic?
  2. Provide virtual ECUs: Integrate ECUs as vECU or SiL simulation – via API or upload.
  3. Orchestrate test jobs: Connect existing test suites and execute them automatically in parallel.
  4. Define quality gates: Only what passes virtually moves on to the HiL test bench.
  5. Focus on HiL: Reserve the test bench for hardware-related tests and major releases.

How these steps come together into an end-to-end approach is covered in our guide to Software-Defined Testing.

‍

Checkliste: Ist Ihre XiL-Strategie ausbalanciert?

‍

Conclusion: The stage follows the test question

MiL, SiL, and HiL are not competitors, but tools for different classes of errors. By assigning every test question to the most cost-effective, appropriate stage, you shift the bulk of testing to the virtual environment and free up the HiL test bench for what only real hardware can do.

FAQ

Frequently asked questions about HiL, SiL, and MiL

Was ist der Unterschied zwischen SiL und HiL?

Software-in-the-Loop (SiL) testet den Seriencode rein virtuell ohne spezielle Embedded-Hardware, simuliert auf gängiger Computer-Hardware, Hardware-in-the-Loop (HiL) testet das reale Steuergerät an einem Echtzeit-Simulator. SiL skaliert parallel und kostengünstig in der Cloud, HiL bleibt für hardwarenahe Tests und die finale Freigabe nötig.

Was ist der Unterschied zwischen MiL und SiL?

Model-in-the-Loop (MiL) testet das Funktionsmodell, Software-in-the-Loop (SiL) testet den daraus erzeugten oder programmierten Seriencode. Der Vergleich beider Ergebnisse im Back-to-Back-Test zeigt, ob der Code sich wie das Modell verhält.

Was bedeutet XiL?

XiL steht für X-in-the-Loop und ist der Oberbegriff für Model-in-the-Loop, Software-in-the-Loop, Processor-in-the-Loop, Hardware-in-the-Loop und Vehicle-in-the-Loop. Das „X" bezeichnet den jeweiligen Prüfling, der in einem geschlossenen Regelkreis mit einer simulierten Umgebung getestet wird.

Kann SiL den HiL-Test ersetzen?

Software-in-the-Loop (SiL) kann Hardware-in-the-Loop (HiL) nicht vollständig ersetzen, aber stark entlasten. Funktionslogik, Integration und die Regression nicht hardwarerelevanter Funktionen lassen sich virtuell absichern. Elektrisches Verhalten, Busauslegung, Timing und die End-to-End-Kommunikation über alle ISO/OSI-Schichten brauchen weiterhin reale Steuergeräte.

Was ist Processor-in-the-Loop (PiL)?

Processor-in-the-Loop (PiL) ist eine Zwischenstufe zwischen SiL und HiL, bei der der Seriencode auf dem Zielprozessor oder einem Evaluation Board läuft. PiL deckt Compiler- und Laufzeiteffekte auf, ohne ein komplettes Steuergerät am Prüfstand zu benötigen.

Magazin

Weitere Beiträge

Alle Beiträge ansehen ›