Building a physical prototype of an automotive ECU or system can be time-consuming and expensive. Virtual Prototyping (VP) addresses this by creating an executable software model of the system that can run much earlier than physical hardware is available. SHARC embraces virtual prototyping to enable early experimentation and testing, and extends it with a concept called SaVeSoC (Safety-aware Virtual Prototype evaluation and verification of a System on Chip).
Here’s how SHARC leverages virtual prototyping:
SystemC/TLM Models: SHARC uses simulation models written in SystemC (and SystemC AMS for analog/mixed-signal parts) to represent the behavior of hardware components. SystemC is a C++ library that allows modeling of hardware at various levels, including the Transaction Level Modeling (TLM) which is often used for fast simulation of systems. For instance, instead of a cycle-accurate model of a microcontroller, a TLM model might simulate the processing time of tasks without toggling every gate signal, greatly speeding up simulation. SHARC comes with a library of such models (sometimes called the System Component Library). This library includes generic models for processors, memories, buses, analog sensors, actuators, etc. Because these models exist, when the engineer builds the UML/MARTE model of the system, they can link each UML component to a ready-to-use simulation model from the library.
Automatic VP Generation: Once the system architecture is modeled (and possibly after performing some safety analyses on it, which we’ll cover later), SHARC can automatically generate a virtual prototype from that model. Essentially, the tool reads the UML/MARTE description of hardware components and connections, and then produces a SystemC representation (using templates or a generator like OVP iGen from the Open Virtual Platforms standard). The result is an executable simulation of the hardware platform. For example, if your model includes an ARM-based microcontroller, a CAN bus, and sensors, the generation process will produce a SystemC program where an ARM core model, CAN bus model, and sensor models are instantiated and interconnected as specified.
Execution of Software on VP: A virtual prototype’s purpose is not just to simulate hardware in isolation, but to run the actual embedded software in a controlled environment. The SHARC framework supports loading firmware or control software onto the processor models in the VP. This means you can start testing your control algorithms and software logic before real hardware exists. If the BMS (Battery Management System) software, for example, is ready, you could run it on the VP of the BMS hardware and see how it behaves.
Safety-Aware Virtual Prototyping (SaVeSoC): What makes SHARC’s approach safety-aware? SaVeSoC augments the virtual prototype with the capability to evaluate safety behavior. In practice, this means two things:
- Fault Injection and Simulation: The virtual prototype environment allows injection of faults into the simulation to mimic hardware failures or extreme conditions. For instance, you can simulate a sensor giving a faulty reading, a bit-flip in memory, or a broken communication link. By injecting such faults in a controlled way, engineers can observe how the system responds – does the safety mechanism kick in? Is the fault detected and mitigated? This is invaluable for verifying that the design meets the safety requirements (which often assume certain faults will be handled). Instead of waiting for hardware testing or worse, an incident in the field, you can test fault scenarios in silico.
- Built-in Monitoring of Safety Metrics: The SaVeSoC framework can monitor events relevant to safety during simulation. For example, it can track if a fault propagated to a hazardous situation without being controlled (which would relate to single-point faults in ISO 26262 terms). By running many simulations with various faults, you can gather evidence about the Single Point Fault Metric (SPFM) and Latent Fault Metric (LFM) for the design. SPFM represents the percentage of single failures that are detected or controlled (ISO 26262 mandates SPFM above 97% or 99% for high ASILs), and LFM similarly for multiple-point failures. SaVeSoC’s ability to simulate and measure these give an early indication if the design’s architecture is robust enough. Additionally, by integrating known component failure rates and using fault trees, the simulation results can help estimate the Probabilistic Metric for random Hardware Failures (PMHF), essentially the failure rate per hour – which for ASIL D needs to be below a threshold (on the order of 10^(-8) per hour).
Integration with Functional Models: Importantly, SHARC doesn’t treat the VP as an isolated artifact. Instead, once the virtual prototype (especially of hardware components) is generated, SHARC integrates it back into the overall system model context. In practical terms, you might have a high-level functional model (say, using MATLAB/Simulink or a high-level UML behavior for the system) and you replace parts of it with the detailed VP for the hardware. This allows a mix-and-match simulation: parts of the system are detailed (running actual software on a CPU model) while other parts may still be abstract. This integration helps verify interfaces and functional correctness: for example, ensuring that the software running on the VP correctly communicates with other system components in the model (like other ECUs or a plant model representing the physical world). It’s a way to gradually refine the system: start with everything abstract and gradually swap in real implementations and test each time.
By employing virtual prototyping early, SHARC helps teams validate design decisions at a stage where changes are much cheaper. If a problem is found (say the CPU chosen isn’t powerful enough, or the fault handling strategy doesn’t meet timing requirements), it’s far easier to adjust the model and regenerate a new prototype than it would be to re-spin a hardware design or rewrite a bunch of code after physical testing. In the next section, we’ll look at how formal safety analysis methods are incorporated alongside this simulation-centric approach.