Simulink Real-Time (formerly xPC Target) is a MathWorks product that compiles Simulink and Stateflow models into real-time C code and executes them on a dedicated target computer, enabling Hardware-in-the-Loop (HIL) testing and rapid control prototyping. It provides a deterministic execution environment with a real-time kernel, ensuring model computations complete within precisely bounded time steps for synchronized interaction with physical hardware like sensors and actuators.
Glossary
Simulink Real-Time

What is Simulink Real-Time?
A technical definition of the MathWorks product for deterministic real-time execution of Simulink models.
The system operates by deploying the compiled application from a host PC to a target machine, which interfaces with the device under test (DUT) via specialized I/O boards for analog, digital, and communication protocols. This creates a closed-loop validation environment where the physical controller interacts with a simulated plant model in real time, allowing engineers to test embedded software against a digital twin before physical deployment.
Key Features and Capabilities
Simulink Real-Time is a MathWorks product that compiles Simulink and Stateflow models into real-time C code and executes them on a dedicated target computer for Hardware-in-the-Loop (HIL) testing and rapid prototyping.
Real-Time Code Generation
The core function is the automatic translation of Simulink block diagrams and Stateflow charts into optimized, standalone C code. This code is compiled with a real-time kernel for execution on a dedicated target machine. The process ensures deterministic execution, where the model's step time is guaranteed to be met on every cycle, which is critical for closed-loop control validation.
- Rapid Prototyping: Enables quick iteration by deploying controller designs directly to hardware.
- Production Code Foundation: The generated code often serves as a reference for final embedded software.
Target Computer Execution
The generated real-time application runs on a dedicated target computer, physically separate from the host PC used for development. This target is typically a real-time operating system (RTOS) like the MathWorks real-time kernel or a commercial RTOS (e.g., VxWorks).
- Deterministic Scheduling: The RTOS guarantees task timing, isolating the real-time model from non-deterministic processes on a general-purpose OS.
- Hardware-in-the-Loop Core: The target computer hosts the plant model and interfaces with physical I/O, forming the heart of the HIL test system.
I/O Hardware Integration
Provides extensive support for interfacing with physical hardware through I/O boards installed in the target computer. These boards handle the critical signal conversion between the digital simulation and the analog/digital world of the Device Under Test (DUT).
- Analog & Digital I/O: For reading sensor voltages and driving actuator commands.
- Communication Protocols: Direct support for CAN, EtherCAT, ARINC 429, and serial interfaces.
- Signal Conditioning: Built-in scaling and calibration for matching sensor/actuator ranges.
Interactive Real-Time Interface
Engineers can interact with and monitor the running real-time application from the host Simulink environment without stopping execution. This enables dynamic parameter tuning, signal monitoring, and data logging.
- Tunable Parameters: Adjust gains, setpoints, or model coefficients on-the-fly.
- Real-Time Data Visualization: Plot signals as they are generated by the target.
- Triggered Data Capture: Log high-speed data based on specific events or conditions.
Deterministic Execution & Timing Analysis
Ensures the model executes within a hard real-time deadline on every time step. The system provides tools for timing analysis to verify that the worst-case execution time (WCET) is less than the sample period.
- Sample Time Enforcement: Guarantees model tasks complete before the next sample period begins.
- Overrun Detection: Flags and logs any instance where the real-time deadline is missed, a critical failure in HIL testing.
- Multirate Execution: Supports models with multiple, synchronized sample rates.
Integration with HIL Test Automation
Functions as the core real-time engine within larger automated test systems. It integrates with frameworks like Simulink Test and SystemTest for creating, managing, and executing comprehensive test suites.
- Automated Test Sequences: Run pre-defined test vectors and scenarios.
- Requirements Tracing: Link test cases to high-level requirements (e.g., with Simulink Requirements).
- Continuous Integration (CI): Supports integration into CI/CD pipelines for regression testing.
How Simulink Real-Time Works: The HIL Pipeline
Simulink Real-Time enables Hardware-in-the-Loop (HIL) testing by providing a deterministic pipeline from model to physical hardware.
Simulink Real-Time (formerly xPC Target) is a MathWorks product that compiles Simulink and Stateflow models into real-time C code and executes them on a dedicated target computer for HIL testing and rapid prototyping. The pipeline begins with a plant model—a virtual representation of the physical system—which is compiled with a fixed-step solver. This generated code is then deployed to a real-time target machine, a separate computer running a deterministic kernel that guarantees execution within strict microsecond-level timing deadlines, forming the core of the simulation engine.
The target machine interfaces with physical hardware through specialized I/O boards that handle analog/digital signal conversion and communication protocols like CAN or EtherCAT. In the HIL loop, the model receives actual sensor signals from the Device Under Test (DUT), processes them through the simulated plant dynamics, and outputs corresponding actuator commands. This closed-loop validation allows engineers to test embedded controllers against a high-fidelity, real-time virtual environment before physical prototype availability, significantly de-risking development.
Primary Use Cases and Industries
Simulink Real-Time is a dedicated platform for executing Simulink and Stateflow models as compiled C code on a real-time target computer. Its primary applications span industries where validating control logic against a simulated physical environment before physical deployment is critical for safety, cost, and development speed.
Simulink Real-Time in the V-Model: MIL, SIL, PIL, HIL
A comparison of the four primary testing methodologies within the V-model development cycle, detailing the role of Simulink Real-Time in executing these tests.
| Validation Phase | Description | System Under Test (SUT) | Plant Model / Environment | Primary Objective | Simulink Real-Time Role |
|---|---|---|---|---|---|
Model-in-the-Loop (MIL) | Algorithmic validation within the simulation environment. | Simulink/Stateflow model (floating-point). | Simulink model of the physical system (plant). | Verify control logic and system dynamics. No code generation. | Not used. Purely desktop simulation. |
Software-in-the-Loop (SIL) | Validation of generated or handwritten source code on a host PC. | C/C++ code compiled for the host PC. | Simulink model of the plant, run on the host PC. | Verify functional equivalence of code to model. Processor-agnostic. | Not typically used. Executes on standard host OS. |
Processor-in-the-Loop (PIL) | Validation of compiled executable on the target processor. | C/C++ code cross-compiled and running on the target embedded processor (e.g., microcontroller). | Simulink model of the plant, run on the host PC. | Verify numerical behavior and timing on the target processor. | Can provide the target execution environment and host communication link. |
Hardware-in-the-Loop (HIL) | Validation of the embedded controller with real I/O in a closed loop. | Physical Electronic Control Unit (ECU) with production software. | High-fidelity, real-time Simulink model of the plant, executed deterministically. | Test integrated hardware/software system with simulated sensors/actuators under realistic & edge-case conditions. | Core platform. Executes the real-time plant model and manages physical I/O interfacing with the ECU. |
Frequently Asked Questions
Common questions about Simulink Real-Time, a MathWorks product for executing Simulink and Stateflow models on dedicated hardware for real-time testing and rapid prototyping.
Simulink Real-Time (formerly xPC Target) is a MathWorks product that compiles Simulink and Stateflow models into optimized, real-time C code and executes them with deterministic timing on a dedicated target computer. It works by taking a control algorithm or system model designed in the Simulink graphical environment, automatically generating code, and deploying it to a real-time operating system (RTOS) running on separate target hardware. This target machine, connected to physical sensors and actuators via I/O boards, runs the model in a hard real-time loop, ensuring computational deadlines are met for Hardware-in-the-Loop (HIL) testing and rapid control prototyping.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Simulink Real-Time operates within a broader ecosystem of real-time simulation and testing methodologies. These related concepts define the workflows and technologies used for validating embedded systems.
Real-Time Simulation
Real-time simulation is a computational paradigm where a model of a physical system is executed at a speed that matches or exceeds the actual passage of time. This deterministic timing is non-negotiable for HIL testing, as the simulated plant must react to hardware inputs within the strict deadlines of the physical world.
- Hard Requirement: Simulation step time must be less than or equal to real-world sample time.
- Deterministic Execution: Outputs must be produced within a guaranteed, bounded timeframe.
- Simulink Real-Time Role: It compiles Simulink models into real-time C code and runs them on a dedicated target computer with a real-time kernel to achieve this deterministic execution.
Rapid Control Prototyping (RCP)
Rapid Control Prototyping (RCP) is the complementary workflow to HIL testing. Instead of testing physical hardware against a simulated plant, RCP uses a real-time target computer (like one running Simulink Real-Time) to execute a prototype control algorithm and directly command physical actuators, with feedback from real sensors.
- Primary Goal: Accelerate the design and field-testing of new control algorithms.
- Hardware Role: The real-time computer acts as the controller, interfacing with the actual plant.
- Connection to Simulink Real-Time: The same toolchain is used to deploy and execute controller models in real-time on prototype hardware, allowing engineers to iterate designs quickly before committing to embedded code.
Real-Time Operating System (RTOS)
A Real-Time Operating System (RTOS) is a specialized OS kernel that provides deterministic scheduling, interrupt handling, and inter-task communication. It is the foundational software layer that enables a standard processor to guarantee real-time performance.
- Key Feature: Preemptive, priority-based scheduling ensures high-priority tasks (like model execution) always meet their deadlines.
- Simulink Real-Time Basis: The product includes a streamlined, real-time kernel (formerly based on QNX) that runs on the target PC, managing the execution of the compiled model, I/O drivers, and communication tasks.
- Contrast with GPOS: Unlike general-purpose operating systems (Windows, Linux), an RTOS sacrifices flexibility and features for timing predictability.
xPC Target
xPC Target was the predecessor product name for Simulink Real-Time. It refers to the legacy technology for turning a standard PC into a real-time target machine using a bootable real-time kernel.
- Historical Context: The original solution for real-time execution of Simulink models on inexpensive PC hardware.
- Evolution: The technology was rebranded and integrated more deeply into the Simulink environment as Simulink Real-Time.
- Technical Continuity: Many core concepts—like the target boot disk, real-time kernel, and host-target communication—remain central to the current product. Understanding xPC Target provides historical insight into the tool's architecture.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us