Overview
A virtual electronic control unit (V-ECU) is a software component that runs in a simulated environment and mimics the functions of a physical hardware controller. It is used for development, testing, and verification of embedded systems without relying on physical hardware.
Two Main Implementation Approaches
There are two primary approaches for implementing virtual ECUs for automotive microcontrollers. One approach runs the binary image of the controller's main chip (for example, HEX or S19 files) on a chip-specific PC emulator to simulate its behavior. The other approach decouples hardware and software at the source level and recompiles the ECU source code with an x86 toolchain (for example, MinGW or MSVC) to generate x86-compatible executables (such as FMU files) that run in a simulation environment for testing.
V-ECU Classification by Functionality
Based on functional requirements, V-ECUs are commonly categorized as follows:
Type-0 / Level-0 V-ECU: Application-level functional model
This type is used to validate control logic and application-level algorithms. Models are typically generated with tools such as MATLAB/Simulink or ASCET. Testing focuses on the model itself rather than generating integration-ready code. Common test scenarios include model-in-the-loop (MiL) validation during early concept and functional verification stages.
Type-1 / Level-1 V-ECU: Application-layer virtual ECU
Type-1 V-ECUs contain product-level application software (ASW) code. They can test application-layer functionality for a single ECU or functions distributed across multiple ECUs. These V-ECUs do not require direct hardware interaction and are suitable for functional development and software-in-the-loop (SiL) testing, accelerating prototyping and functional verification.
Type-2 / Level-2 V-ECU: Virtual ECU with simulated BSW
In addition to application code, this type includes basic software (BSW) components for simulation, such as simplified communication stacks. It enables more comprehensive testing of application software, especially scenarios involving communication buses, and supports more complex bus communication and integration tests.
Type-3 / Level-3 V-ECU: Virtual ECU with product-level BSW
Type-3 V-ECUs include most of the basic software (BSW) along with the application software. They can model software architectures closer to a real ECU and support component integration tests, functional chain tests, and network integration tests. This level is suitable for advanced system testing, including physical-layer communication simulation.
Type-4 / Level-4 V-ECU: Target binary image
Type-4 V-ECUs use the full binary image compiled for a specific hardware target and simulate the microcontroller instruction set, running on a target chip emulator within a PC environment. This approach supports detailed examination of software-hardware interactions and is useful for developing MCAL drivers or complex device drivers (CDD). Although Type-4 V-ECUs preserve the target toolchain and full binary, they usually require higher initial investment and have lower simulation efficiency, which limits their practical use cases.
Practical Use and Trade-offs
These V-ECU types can be used in parallel during ECU software development. Type-1 to Type-3 (Level 1 to Level 3) V-ECUs are typically compiled for x86 PC architectures and, compared with Type-4 V-ECUs, generally offer better simulation performance, easier code debugging, faster simulation speed, and shorter development feedback cycles.
Tool Support for Generating Virtual ECUs
Some toolchains can package existing C source code or precompiled binary libraries (x86 static libraries) into FMU-format virtual ECUs. They can also build FMU-format V-ECUs from dynamic libraries that include symbol information. Supported V-ECU levels typically range from Type-1 to Type-3.
FMU Integration
FMU files generated for V-ECUs can be imported into any simulation environment that supports the FMU format. The choice of simulation environment depends on requirements such as simulation fidelity, speed, and toolchain integration. Common modeling tools that support FMU import/export include MATLAB Simulink, ASCET, CarSim, Amesim, and AVL Cruise M.
Typical Capabilities of FMU-based V-ECU Builders
- Lightweight virtual ECU builds suitable for CI/CD pipelines, producing small artifacts with low computational cost in the simulation environment.
- Automated generation workflows that use a "configure once, build repeatedly" approach to reduce manual effort in producing virtual ECUs.
- Faster compile and runtime performance compared with running on real hardware, reducing development and testing time.
- Convenient debugging in simulation environments, enabling rapid identification and correction of code issues to improve software quality.
- Flexible application across development stages, from model-level tests to system-level integration, providing broad functional verification except for hardware driver validation.
ALLPCB
