Virtual HIL

# Virtual Hardware-in-the-Loop (vHIL) simulator.

Scale multi-ECU integration testing, FMI plant co-simulation, and deterministic fault matrices across every pull request without waiting on shared physical HIL racks.

[Start now](https://app.circuittwin.ai/try) [Compare with physical HIL](https://circuittwin.ai/compare/hil-benches)

## MiL vs SiL vs vHIL vs physical HIL.

vHIL executes target binaries against silicon-calibrated peripherals at software CI speed.

| Stage                      | Code executed                           | Hardware model                             | CI scaling                              | Fault injection                                     |
| -------------------------- | --------------------------------------- | ------------------------------------------ | --------------------------------------- | --------------------------------------------------- |
| MiL (Model-in-the-Loop)    | Control algorithms in Simulink / Python | No MCU binary or registers                 | Fast desktop runs                       | Plant-level signals only                            |
| SiL (Software-in-the-Loop) | Host-recompiled C/C++ code              | Stubbed HAL and OS calls                   | High CI concurrency                     | Misses register, DMA, and bus faults                |
| vHIL (CircuitTwin)         | Compiled target ELF / HEX / BIN         | Silicon-calibrated MCU & PCB digital twins | Parallel cloud, local, or air-gapped CI | Deterministic bus, sensor, power, and timing faults |
| Physical HIL rack          | Flashed onto real ECUs                  | Full physical bench and I/O cards          | 1 bench per hardware rack ($50k+)       | Slow setup; hard to reproduce race conditions       |

## Deterministic fault matrices in CI.

Sweep CAN shorts, frozen sensors, and rail brownouts across your firmware builds with reproducible trace bundles.

[Talk with us about Enterprise vHIL →](https://circuittwin.ai/contact)

Define fault scenarios in YAML next to your source code and run them locally, in cloud CI, or inside air-gapped networks with signed offline licences. Every failing cell records `trace.jsonl`, `isr.jsonl`, and `signals.vcd` for deterministic replay.

tests/vhil-fault-matrix.yaml

suite: vehicle-powertrain-vhil
scene: scenes/six-ecu-vehicle.yaml
matrix:
  faults:
    - none
    - { bus: can0, kind: short_to_ground, at_ms: 420 }
    - { part: imu0, kind: frozen_output, at_ms: 800 }
    - { rail: vbat, kind: brownout_mv, value: 2700, at_ms: 1100 }
  assert:
    - node: safety-ecu
      uart_contains: "SAFE_STATE_ENTERED"
      within_ms: 1500

`ct test matrix run tests/vhil-fault-matrix.yaml --junit out.xml`

## Common questions.

**What is the difference between SiL, vHIL, and physical HIL?**

SiL recompiles application logic for a host PC and stubs out hardware drivers. Virtual HIL (vHIL) executes your real target microcontroller binary on digital twins of the CPU, peripherals, buses, and plant environment. Physical HIL uses real target hardware racks for final sign-off.

**Does CircuitTwin support FMI co-simulation and 3D plant models?**

Yes. You can couple multi-ECU firmware runs to FMU plant models over FMI co-simulation or drive interactive 3D vehicle and robotics worlds in Proving Ground with deterministic lock-step virtual time.

**Can vHIL run in air-gapped aerospace or automotive CI environments?**

Yes. Team and Enterprise plans include signed 30-day offline licences (ct --network none) alongside deterministic SHA-256-manifested trace bundles and compliance evidence packs.

**Does vHIL completely replace physical HIL racks?**

Teams still run physical HIL and EMC tests for final certification and analog sign-off. Virtual HIL moves 90% of daily regression, fault-injection, and multi-ECU integration testing into every pull request so physical benches stop being a bottleneck.

## Related guides.

CAN Bus Firmware Simulator Test multi-ECU CAN and CAN FD buses, DBC signals, and bus-off recovery in lock-step. [Explore CAN sim →](https://circuittwin.ai/can-bus-firmware-simulator)

CircuitTwin vs Physical HIL Benches Detailed breakdown of cost, turnaround time, and where physical rigs remain required. [Compare HIL →](https://circuittwin.ai/compare/hil-benches)

3D Virtual Proving Ground Run closed-loop multi-MCU vehicle and robotics firmware in a 3D physics world. [Open overview →](https://circuittwin.ai/virtual-proving-ground)

Test Firmware Without Hardware Set up zero-hardware GitHub Actions and GitLab CI for embedded repositories. [Read CI guide →](https://circuittwin.ai/test-firmware-without-hardware)
