Model-Based Development for ADAS, Part 1: V-Model, MIL to HIL, ISO 26262
What model-based development is and why ADAS teams use it: the V-model from requirements to a Simulink/Stateflow model, code generation, MIL, SIL, PIL, HIL and vehicle tests, where ISO 26262 and ISO 21448 (SOTIF) fit, how ACC, AEB and LKA are built from sensors to actuators, and the tools vendors document for each step.

Model-based development (MBD) is a way of building automotive control software in which the feature is first written as an executable model, usually in Simulink and Stateflow, and tested in simulation before any code exists. Production C code is then generated from that model. The same tests are re-run on the code (SIL, PIL), on the real control unit (HIL) and finally in the vehicle. ADAS teams use it because features such as adaptive cruise control and emergency braking are closed-loop controllers that must be tested across thousands of traffic scenarios and traced to safety standards (ISO 26262 and ISO 21448), and a model is the cheapest place to find mistakes.
In short
- ISO 26262 (second edition, December 2018) is the functional-safety series for safety-related electrical and electronic systems in series-production road vehicles, excluding mopeds. It grades functions from ASIL A to ASIL D, D being the most stringent (ISO; MathWorks).
- ISO 21448:2022 (SOTIF) covers a different risk: hazards from functional insufficiencies, such as a sensor or algorithm that is working as designed but misreads the scene. It explicitly targets emergency intervention systems and driving automation Levels 1 to 5 (ISO).
- MathWorks states that TÜV SÜD has certified MATLAB, Simulink, Stateflow, Embedded Coder and Polyspace as qualified for use up to ASIL D, and that back-to-back model-versus-code testing with processor-in-the-loop is strongly recommended by ISO 26262-6 for ASIL C and D.
- India's draft AIS-185 would make automatic emergency braking compulsory on new M1 car models from 1 October 2030 and on all M1 models from 1 October 2032 (MoRTH draft, reported by Autocar India on 23 Oct 2026).
This is Part 1 of a two-part guide for engineering students and early-career engineers who want to work on ADAS software. It explains what MBD is, how the V-model, MIL, SIL, PIL and HIL fit together, where the safety standards come in, and which tools are used. Part 2 takes one feature, adaptive cruise control, through the whole workflow with written requirements, a controller model, a closed-loop simulation and coverage results. To compare course options, see all 11 Skill-Lync ADAS and autonomous driving courses in one table, from 12-week courses in model-based development, validation, computer vision and control to full programs.
What is model-based development (MBD)?
Model-based development means the model is the design. Instead of writing a specification document and then hand-coding C, engineers build a block diagram or state machine that can be simulated, tested and finally turned into production code automatically. Requirements, tests and generated code all link back to that one model.
Think of it as building and crash-testing a scale model of a bridge before pouring concrete, except that here the "scale model" is the actual logic that will run in the car. Three activities repeat throughout:
- Modelling. The control logic (for example "keep a 1.4 s gap to the car ahead") is drawn in Simulink blocks and Stateflow charts. A second model, the plant, represents what is being controlled: the vehicle's motion, the brakes, the road and the other traffic.
- Simulation. The controller and plant run together in closed loop on a PC. You can try conditions that are dangerous or expensive to reproduce physically, such as a car cutting in 20 m ahead at 90 km/h, as many times as you like.
- Verification and validation. Every requirement gets a test. The tests are run on the model first and then reused on the generated code, the electronic control unit (ECU) and the vehicle, so the same question is asked at every stage.
Not every line of a car's software has to be modelled. MBD fits best where the software is control and decision logic, which is exactly what the core of an ADAS feature is.
Why do ADAS teams use model-based development?
ADAS teams use MBD because driver-assistance features are feedback controllers wrapped in decision logic, and their behaviour only makes sense in closed loop with a moving vehicle and other traffic. A model lets the team test that loop in simulation from week one, reuse the same tests on the code and hardware, and show auditors which test covers which safety requirement.
Cars once had a handful of electronic control units with small programs. Today, comfort, infotainment, powertrain and driver-assistance features are spread across many ECUs, and much of what the car does is defined in software. Our explainer on the software-defined vehicle shows where that trend is heading. When software decides whether a car brakes, a bug is a safety problem, and a software fix after launch can mean a recall.
Four practical reasons make MBD the default for ADAS function development:
- Front-loading. Most logic errors are found in model-in-the-loop simulation, before hardware exists. A wrong sign in a gap controller costs minutes on a PC and far more on a test track.
- Scenario coverage. A feature such as automatic emergency braking (AEB) must behave correctly for lead cars, pedestrians, cut-ins, curves, rain and sensor dropouts. Simulated scenarios can be multiplied and re-run on every change.
- Traceability. ISO 26262 expects each safety requirement to be traceable to design and to a test. Tools link requirement text to model blocks, tests and generated code, so the trace is kept as a by-product of the work.
- Code generation. Generating C code from a reviewed, tested model removes a hand-translation step, and back-to-back testing can show that the code behaves like the model.
How does the V-model work in model-based development?
The V-model is the standard picture of automotive development. The left arm goes down from feature requirements through system architecture to the detailed design, which in MBD is the Simulink model. The bottom is implementation, here code generation. The right arm goes up through testing levels, and each test level checks the design level opposite it.
For a general introduction to the V-cycle in vehicle programs, with the ARAI test standards that sit on its right arm, watch the free automotive standards and V-cycle workshop. In an MBD project for one ADAS feature, the steps usually run like this:
- Software requirement analysis. The feature requirement ("the car follows a slower lead vehicle at a set time gap") is broken into software requirements that a test can pass or fail, with numbers and units. A team usually splits this work, with experienced engineers reviewing it.
- High-level design (architecture). The function is split into modules with defined interfaces: which signals come from the radar, which go to the brake controller, at what rate and in what units. Often a base model already exists and the new function is integrated into it.
- Low-level design (the model). Each module is built in Simulink and Stateflow, with its parameters held in a data dictionary rather than scattered in scripts.
- Model-in-the-loop (MIL) testing. The controller model runs against a plant model and scenarios. This checks the engineering logic: does this input produce the required output?
- Code generation. A code generator such as Embedded Coder turns the model into C source and header files plus the supporting files needed to build it.
- Software-in-the-loop (SIL) and processor-in-the-loop (PIL). The generated code is compiled and run with the same test inputs, and its outputs are compared with the model's. SIL is still needed after MIL because it tests the code, not the diagram.
- Hardware-in-the-loop (HIL). The code is flashed onto the production ECU, which is wired to a real-time simulator that pretends to be the rest of the car.
- Vehicle testing and acceptance. Proving-ground and road tests confirm the feature does what the customer and the regulations require.
What is the difference between MIL, SIL, PIL and HIL?
The four "in-the-loop" stages differ in how much of the system is real. MIL tests the model, SIL tests the generated code on a PC, PIL runs the compiled code on the target processor, and HIL tests the real ECU against a real-time simulation of the vehicle. Each stage replaces one more simulated piece with the real thing.
| Stage | Where it runs | Typical faults it finds |
|---|---|---|
| MIL | Simulink on a PC | Wrong logic, wrong signs and units, missing modes, requirement misunderstandings |
| SIL | Generated code compiled on the PC | Differences between model and code: data types, overflow, fixed-point scaling, code-generation settings |
| PIL | Cross-compiled code on the target processor or an instruction-set simulator | Target compiler and processor effects; execution time and stack use |
| HIL | Production ECU wired to a real-time simulator | Timing, I/O and bus (CAN/Ethernet) integration, diagnostics, reaction to injected faults |
| Vehicle | Test track and public roads | Real sensor behaviour, comfort, anything the models left out |
MathWorks documents SIL as compiling and running the generated code on the development computer, and PIL as cross-compiling it and running the object code on target hardware or an instruction-set simulator. Both are non-real-time, and both exist to show that model and code are numerically equivalent. HIL rigs such as dSPACE SCALEXIO are built for real-time simulation and ECU testing at signal or power level.
Where do ISO 26262 and ISO 21448 (SOTIF) fit?
ISO 26262 deals with hazards caused by malfunctions: a failed sensor, a stuck signal, a software bug. ISO 21448 (SOTIF, safety of the intended functionality) deals with hazards when nothing has failed but the function is not good enough for the situation, such as a camera that misreads glare. ADAS features need both, and MBD provides the evidence for each.
| ISO 26262 (functional safety) | ISO 21448 (SOTIF) | |
|---|---|---|
| Current edition | Second edition, 2018 (parts 1-12); revision in progress | First edition, June 2022 |
| Hazard source | Malfunctioning behaviour of safety-related E/E systems, such as hardware faults and software bugs, including their interactions | Functional insufficiencies: incomplete specification or performance limits of sensors and algorithms, plus reasonably foreseeable misuse |
| ACC example | The wheel-speed signal freezes, so the controller thinks the car is slower than it is | The radar is working, but the feature was never specified to brake for a stopped car that appears after a cut-out |
| Main output | ASIL (A to D) per safety goal, safety requirements, verification evidence | Identified triggering conditions, known and unknown hazardous scenarios, validation evidence |
| Where MBD helps | Requirement traceability, coverage, back-to-back model/code testing, qualified tools | Large simulated scenario sets, randomised operating conditions, sensor models |
The ACC example is not hypothetical wording. The ISO 15622:2018 abstract for adaptive cruise control states that the system is not required to react to stationary or slow-moving objects, and that a full-speed-range system stops behind a tracked vehicle only within its limited deceleration. That is a design limit, not a fault, so it is SOTIF territory, and it is why AEB exists as a separate function. Part 2 simulates exactly this case.
On the tooling side, the MathWorks IEC Certification Kit provides workflow documents, TÜV SÜD certificates and test suites for using its tools in ISO 26262 projects. A 2024 MathWorks technical article on ISO 26262 for automated driving describes the typical chain: requirements linked in Requirements Toolbox, model checks in Simulink Check, MIL tests followed by SIL and PIL back-to-back tests, coverage in Simulink Coverage, and Polyspace for static analysis of the generated code. For randomised SOTIF testing it recommends varying operating conditions.
What do ACC, AEB and LKA do, and which sensors do they use?
Adaptive cruise control (ACC) holds a set speed and slows to keep a time gap behind a slower car. Automatic emergency braking (AEB) brakes on its own when a collision is imminent. Lane keeping assist (LKA) steers to keep the car in its lane. All three read a front radar and/or camera, run in an ADAS controller, and command the powertrain, brakes or steering.
| Feature | Main inputs | Control output | Actuator |
|---|---|---|---|
| ACC | Ego speed, gap and relative speed to the lead car from radar and camera fusion, driver set speed and time gap | Longitudinal acceleration request (MathWorks example limits: -3 to +2 m/s²) | Powertrain torque and brakes |
| AEB | Relative distance and speed of the lead object from radar and camera, ego speed | Warning, then staged partial braking and full braking based on time-to-collision | Brake system and HMI |
| LKA | Lateral offset from the lane centre, relative yaw angle, road curvature, ego speed | Front steering angle | Electric power steering |
In MathWorks' ACC-with-sensor-fusion reference example, radar supplies range and range rate, the camera gives better lateral position, and a tracker fuses both and picks the "most important object", the closest car ahead in the ego lane. The ACC block keeps a safe distance of default spacing plus time gap times ego speed. With the example's 10 m spacing and 1.4 s gap, that is:
For how the sensors work and how AEB decides when to brake, read how self-driving cars detect and avoid obstacles. For the levels of automation these features belong to, see ADAS and the different levels of automation.
Which tools are used for model-based development in ADAS?
The core MBD toolchain is MATLAB, Simulink and Stateflow for the model, add-ons for requirements, testing, coverage and code generation, and separate real-time and simulation tools for HIL and scenario testing. The table lists what each vendor documents its tool as doing. It is not a ranking, and companies mix tools.
| Tool | Vendor | Used for |
|---|---|---|
| MATLAB, Simulink, Stateflow | MathWorks | Algorithm, block-diagram and state-machine models; simulation |
| Requirements Toolbox | MathWorks | Authoring requirements, linking them to model blocks, tests and code; traceability matrix and gap analysis |
| Simulink Test | MathWorks | Test harnesses, test manager, baseline and equivalence (back-to-back) tests in SIL, PIL and real-time HIL modes |
| Simulink Coverage | MathWorks | Execution, decision, condition and MC/DC coverage of models and code |
| Simulink Check (Model Advisor) | MathWorks | Checks against ISO 26262/IEC 61508 guidance, MAB and JMAAB modelling guidelines, high-integrity and MISRA C checks; reports |
| Embedded Coder | MathWorks | C/C++ code generation for embedded processors, AUTOSAR support, SIL/PIL back-to-back testing, code-to-model traceability |
| Polyspace | MathWorks | Static analysis of code (bugs, MISRA C) |
| SCALEXIO | dSPACE | Real-time HIL simulators for ECU testing, signal- and power-level HIL, bus interfaces |
| CarMaker | IPG Automotive | Virtual test driving for ADAS, AD, powertrain and vehicle dynamics, with road, traffic and sensor models, across MIL, SIL, HIL and vehicle-in-the-loop |
| CANoe | Vector | Development, simulation, analysis and automated testing of ECUs and networks, in both SIL and HIL |
If you are starting out, MATLAB and Simulink fluency matters most. The rest are learned on the job. Skill-Lync's Introduction to Model-Based Development using MATLAB and Simulink (29 hours) covers the modelling side, and Software Verification and Validation and System Testing for Model-Based Development (20 hours) covers MIL/SIL testing and coverage.
What are the benefits and limitations of model-based development?
MBD finds design errors earlier, lets teams reuse tested models across vehicle variants, generates code consistently and keeps traceability almost automatically. Its costs are tool licences, a learning curve, and the risk of trusting a model that is wrong about the real world. A plant model is only as good as its assumptions.
Benefits
- Iterative: change a parameter, re-run every test overnight.
- Reusable: a tested ACC model can be recalibrated for a new vehicle instead of rewritten.
- Faster code delivery: code generation replaces hand translation, and variants can be produced quickly.
- Maintainable: model versions, data dictionaries and test suites live in version control together.
- Audit-ready: requirement, test and coverage reports come out of the same toolchain.
Limitations
- Adoption is hard: teams used to hand coding must learn new tools and modelling standards.
- Large models become complex to review, merge and keep fast.
- Simulation passes are only as credible as the plant and sensor models. Real radar clutter, tyre grip on a wet road and driver behaviour are hard to model, so HIL and vehicle tests stay essential.
- Generated code still needs verification. Back-to-back testing and static analysis exist because "it was generated" is not evidence on its own.
Who does MBD work in the automotive industry, and what jobs does it lead to?
MBD work is done at vehicle makers (OEMs), at Tier 1 suppliers who build ADAS ECUs and sensors, and at engineering-services firms that deliver modelling and testing for both. Entry roles include MBD or Simulink developer, MIL/SIL test engineer, HIL test engineer and, with experience, functional safety engineer.
- OEMs design the car and own the feature requirements. They specify what ACC must do and integrate suppliers' systems.
- Tier 1 suppliers design and build complete systems such as radar sensors or ADAS controllers and their software, and integrate them into ECUs.
- Tier 2 suppliers and service partners work under contract to Tier 1s and OEMs, often on modelling, testing and validation work packages.
In practice the work flows both ways, and a fresher may model a function one month and write HIL test scripts the next. Skills that come up for MBD roles: strong MATLAB and Simulink, reading and writing requirements, modelling standards (MAB guidelines), MIL and SIL testing, and Embedded Coder or AUTOSAR basics. The automotive embedded systems and AUTOSAR course covers the software side, and the Post Graduate Program in Electric Vehicle Design & Development covers MBD as part of a longer program. To see who is hiring, browse companies that hire mechanical engineering freshers in India.
Next: Part 2 builds an adaptive cruise control feature step by step, from testable requirements to a closed-loop simulation, coverage and what changes at SIL and HIL.
Frequently asked questions
Is model-based development the same as model-based design?
In automotive practice the terms are used interchangeably. MathWorks calls it Model-Based Design, and many OEMs and suppliers say model-based development. Both mean an executable model is the central design artefact, and code and tests come from it.
Do I need to know C if I work in MBD?
Yes, at reading level. You will review generated code, debug SIL mismatches and integrate with hand-written modules. You rarely write the control logic in C by hand, but you must understand data types, fixed-point scaling and how the code is scheduled.
Is MIL testing enough to release a feature?
No. MIL proves the model's logic against a plant model. SIL and PIL prove the generated code matches the model, HIL proves the real ECU works with real I/O and timing, and vehicle tests confirm the models were realistic. Each stage catches different faults.
Does ISO 26262 require Simulink?
No. ISO 26262 sets process and evidence requirements, not tools. Teams may use any toolchain, but tools that generate or verify safety-related code need qualification, which is why vendors such as MathWorks provide certification kits.
Which ADAS feature should a student model first?
Adaptive cruise control. It needs only longitudinal motion, has clear numeric requirements (time gap, acceleration limits) and shows both controller design and mode logic. Part 2 of this guide builds one.
Sources and further reading
- ISO, ISO 26262-1:2018 Road vehicles: Functional safety, Part 1: Vocabulary, edition 2, December 2018 (abstract and scope; accessed 20 Nov 2026), and ISO 26262-12:2018, the twelfth part (motorcycles), December 2018.
- ISO, ISO 21448:2022 Road vehicles: Safety of the intended functionality, edition 1, June 2022 (abstract and scope; accessed 20 Nov 2026).
- ISO, ISO 15622:2018 Intelligent transport systems: Adaptive cruise control systems, edition 3, September 2018 (abstract; accessed 20 Nov 2026).
- MathWorks, ISO 26262 solutions page: ASIL A-D, TÜV SÜD certification, IEC Certification Kit, PIL back-to-back testing for ASIL C/D (accessed 20 Nov 2026).
- MathWorks, L. Rosqvist, An ISO 26262 Workflow for Automated Driving Applications Using MATLAB, technical article, 2024.
- MathWorks documentation: SIL and PIL simulations, Embedded Coder, Requirements Toolbox, Simulink Test, Types of model coverage, Check model compliance with the Model Advisor (accessed 20 Nov 2026).
- MathWorks examples: Adaptive Cruise Control System Using Model Predictive Control, Adaptive Cruise Control System block, Adaptive Cruise Control with Sensor Fusion, Autonomous Emergency Braking with Sensor Fusion, Lane Keeping Assist System block (accessed 20 Nov 2026).
- dSPACE, SCALEXIO; IPG Automotive, CarMaker; Vector, CANoe (product pages, accessed 20 Nov 2026).
- Autocar India, MoRTH proposes mandatory AEB for all cars from October 2032, 23 Oct 2026 (AIS-185 draft dates).

