TL;DR
This paper introduces an open-source automation framework that packages cycle-accurate SystemC hardware models into Functional Mock-up Units (FMUs) using the FMI 3.0 standard. This enables seamless, secure, and tool-agnostic co-simulation of hardware and software components, which is crucial for designing modern Software-Defined Vehicles (SDVs).
What Problem Does This Paper Address?
As the automotive industry shifts toward Software-Defined Vehicles (SDVs), vehicles are increasingly reliant on complex software interacting with advanced electronic control units (ECUs), sensors, and controllers. Validating these systems early in the design cycle requires co-simulation—running hardware and software models together before physical prototypes exist.
SystemC is the industry standard for modeling embedded hardware architectures at the Register-Transfer Level (RTL) due to its cycle-accurate timing and event-driven nature. However, SystemC lacks native support for standardized co-simulation interfaces. While the Functional Mock-up Interface (FMI) has emerged as the leading open standard for model exchange and co-simulation, existing attempts to bridge SystemC and FMI suffer from severe limitations: they often rely on expensive proprietary tools, require intrusive modifications to the original SystemC source code, or fail to support critical hardware behaviors like interrupts and dynamic synchronization.
This paper tackles these challenges by providing a fully automated, non-invasive method to wrap any standard SystemC RTL design into an FMI-compliant container.
Methods
The authors propose a three-step automated pipeline to convert a native SystemC design into a Functional Mock-up Unit (FMU) without modifying the underlying model or simulation kernel:
- Parsing & Pre-Processing: The framework parses the top-level entity of the SystemC design to extract port names, directions (input/output), and data types. This information is automatically mapped to FMI data types to generate the mandatory
modelDescription.xmlmetadata file. - FMI Wrapper Construction: A C++ container structure is generated to bridge the SystemC and FMI domains. It instantiates the SystemC model at runtime and binds its ports to FMI variables.
- Simulation Control & Execution: The wrapper implements standard FMI 3.0 functions (like
fmi3DoStep) to advance the simulation.
Advanced Timing & Interrupt Management
A key novelty of this work is how it handles hardware-level timing and interrupts within the FMI standard:
- Step Mode: Synchronizes fixed time steps by mapping
fmi3DoStepdirectly to SystemC'ssc_start(). - Intermediate Update Mode: Dynamically reduces the communication step size when finer temporal resolution is required.
- Interrupt Management: To handle asynchronous interrupts, the framework leverages SystemC's dynamic process spawning (
sc_spawn()). When an interrupt condition (like a rising edge) is detected, it pauses the SystemC simulation (sc_pause()), switches the FMU into FMIEventModeto execute the Interrupt Service Routine (ISR), and then safely resumes normal execution.
The entire pipeline is driven by a lightweight Python script and a simple YAML configuration file, making it completely plug-and-play.
Datasets
The methodology was evaluated using five diverse, heterogeneous SystemC RTL models instead of traditional datasets:
- Arithmetic Logic Unit (ALU): A basic synchronous design used as an introductory baseline.
- Cyclic Redundancy Check (CRC): A high-performance, multi-cycle industrial hardware module supporting 16 independent contexts (provided by an industry partner).
- I2C (Inter-Integrated Circuit) Bus: A hierarchical open-source communication model featuring master/slave modules and explicit error detection.
- RISC Processor: A complex, 5-stage pipelined CPU core operating within a memory hierarchy.
- Delta Sigma Modulator: An analog-to-digital converter model requiring dynamic intermediate updates.
Key Insights and Ideas
- Zero-Modification Wrapper: The biggest "aha" moment is that hardware description languages can be integrated into system-level co-simulations without altering a single line of the original hardware code or hacking the simulation kernel.
- Overhead Amortization: While FMI wrapping introduces a performance penalty due to data translation layers and Python-based master interfaces, this overhead shrinks significantly as the complexity and duration of the simulation scale up. For computation-heavy models, the internal simulation time completely dominates the FMI interface overhead.
- IP Protection via Encapsulation: By compiling the SystemC code into platform-specific binaries (
.dllor.so) inside the FMU, companies can safely share high-fidelity hardware models with third-party software developers without exposing their proprietary source code.
Key Results
The framework was benchmarked against native SystemC execution across various simulation lengths (from 100 ms to 10 s):
- Simulation Speed: For simple models like the ALU, the FMI wrapper introduced a ~12x to 16x slowdown. However, for the complex, industrially relevant CRC module, the slowdown factor dropped to less than 2x for longer simulation runs, demonstrating excellent scalability.
- Memory Footprint: The native SystemC simulations consumed a consistent ~5MB of RAM. The FMI-wrapped versions incurred a stable memory overhead of roughly 20x (due to the FMI runtime and Python master), which scales predictably and remains well within acceptable limits for modern engineering workstations.
- Multi-FMU Co-simulation: The authors successfully demonstrated a realistic third-party scenario by splitting a Delta Sigma Modulator and its testbench into two separate FMUs, synchronizing them smoothly via a Python master without any loss in simulation accuracy.
Limitations and Future Work
While highly effective for RTL designs, the current framework is limited to cycle-accurate hardware models. It does not yet support Transaction-Level Modeling (TLM), which is widely used for faster, high-level architectural exploration.
Additionally, using a Python-based master (FMPy) introduces inherent performance bottlenecks. The authors plan to address these limitations in future work by extending the framework to support SystemC TLM and integrating the generated FMUs into Instruction Set Simulator (ISS) environments like QEMU to enable full-stack hardware-software co-design.
Summary updated