Skip to Main Content Skip to Search
Product Documentation

V-Model for System Development

What Is the V-Model?

The V-model is a representation of system development that highlights verification and validation steps in the system development process. As the following figure shows, the left side of the V identifies steps that lead to code generation, including requirements analysis, system specification, detailed software design, and coding. The right side of the V focuses on the verification and validation of steps cited on the left side, including software integration and system integration.

Depending on your application and its role in the process, you might focus on one or more of the steps called out in the V-model or repeat steps at several stages of the V-model. Code generation technology and related products provide tooling that you can apply at each step.

Types of Simulation and Prototyping in the V-Model

The following table compares the types of simulation and prototyping identified on the left side of the V-model diagram.

 Host-Based SimulationStandalone Rapid SimulationsRapid PrototypingOn-Target Rapid Prototyping
PurposeTest and validate functionality of concept model Refine, test, and validate functionality of concept model in nonreal time Test new ideas and researchRefine and calibrate designs during development process
Execution hardwareHost computer

Host computer

Standalone executable runs outside of MATLAB and Simulink environments

PC or nontarget hardwareEmbedded computing unit (ECU) or near-production hardware
Code efficiency and I/O latencyNot applicableNot applicableLess emphasis on code efficiency and I/O latencyMore emphasis on code efficiency and I/O latency
Ease of use and cost

Can simulate component (algorithm or controller) and environment (or plant)

Normal mode simulation in Simulink enables you to access, display, and tune data during verification

Can accelerate Simulink simulations with Accelerated and Rapid Accelerated modes

Easy to simulate models of hybrid dynamic systems that include components and environment models

Ideal for batch or Monte Carlo simulations

Can repeat simulations with varying data sets, interactively or programmatically with scripts, without rebuilding the model

Can connect to Simulink to monitor signals and tune parameters

Might require custom real-time simulators and hardware

Might be done with inexpensive off-the-shelf PC hardware and I/O cards

Might use existing hardware, thus less expensive and more convenient

Types of In-the-Loop Testing in the V-Model

The following table compares the types of in-the-loop testing for verification and validation identified on the right side of the V-model diagram.

 SIL TestingPIL Testing on Embedded HardwarePIL Testing on Instruction Set SimulatorHIL Testing
PurposeVerify component source code Verify component object codeVerify component object codeVerify system functionality
Fidelity and accuracy

Two options:

Same source code as target, but might have numerical differences

Changes source code to emulate word sizes, but is bit accurate for fixed-point math

Same object code

Bit accurate for fixed-point math

Cycle accurate because code runs on hardware

Same object code

Bit accurate for fixed-point math

Might not be cycle accurate

Same executable code

Bit accurate for fixed-point math

Cycle accurate

Use real and emulated system I/O

Execution platformsHostTargetHostTarget
Ease of use and cost

Desktop convenience

Executes only in Simulink

No cost for hardware

Executes on desk or test bench

Uses hardware — process board and cables

Desktop convenience

Executes only on host computer with Simulink and integrated development environment (IDE)

No cost for hardware

Executes on test bench or in lab

Uses hardware — processor, embedded computer unit (ECU), I/O devices, and cables

Real-time capabilityNot real timeNot real time (between samples)Not real time (between samples)Hard real time

Mapping of Code Generation Goals to the V-Model

The following tables list goals that you might have, as you apply code generation technology, and where to find guidance on how to meet those goals. Each table focuses on goals that pertain to a step of the V-model for system development.

Documenting and Validating Requirements

GoalsRelated Product InformationDemos

Capture requirements in a document, spreadsheet, data base, or requirements management tool

Simulink Report Generator documentation

Third-party vendor tools such as Microsoft Word, Microsoft Excel®, raw HTML, or IBM®Rational® DOORS®

 

Associate requirements documents with objects in concept models

Generate a report on requirements associated with a model

Simulink Verification and Validation™

Requirements Traceability in the Simulink Verification and Validation documentation

Bidirectional tracing in Microsoft Word, Microsoft Excel, HTML, and Telelogic® DOORS

slvnvdemo_fuelsys_docreq
Include requirements tags in generated code

Simulink Verification and Validation

Requirements Information in Generated Code in the Simulink Verification and Validation documentation

rtwdemo_requirements
Trace model blocks and subsystems to generated code and vice versa

Embedded Coder

Code Tracing

rtwdemo_hyperlinks
Verify, refine, and test concept model in nonreal time on a host system

Model Architecture and Design in the Simulink Coder documentation

Model Architecture and Design in the Embedded Coder documentation

Running Simulations and Accelerating Models in the Simulink documentation

rtwdemo_f14
rtwdemo_fuelsys_publish

Run standalone rapid simulations

Run batch or Monte-Carlo simulations

Repeat simulations with varying data sets, interactively or programmatically with scripts, without rebuilding the model

Tune parameters and monitor signals interactively

Simulate models for hybrid dynamic systems that include components and an environment or plant that requires variable-step solvers and zero-crossing detection

Rapid Simulations

Host/Target Communication

rtwdemo_rsim_param_survey_script
rtwdemo_rsim_batch_script
rtwdemo_rsim_param_tuning

Distribute simulation runs across multiple computers

SystemTest™

SystemTest documentation

MATLAB Distributed Computing Server™ documentation

Parallel Computing Toolbox™ documentation

 

Developing a Model Executable Specification

GoalsRelated Product InformationDemos

Produce design artifacts for algorithms that you develop in MATLAB code for reviews and archiving

MATLAB Report Generator

MATLAB Report Generator documentation

 

Produce design artifacts from Simulink and Stateflow models for reviews and archiving

Simulink Report Generator

Simulink Report Generator System Design Description Report

rtwdemo_codegenrpt

Add one or more components to another environment for system simulation

Refine a component model

Refine an integrated system model

Verify functionality of a model in nonreal time

Test a concept model

Real-Time System Rapid Prototyping 

Schedule generated code

Scheduling

Handle Asynchronous Events

rtwdemos, select Multirate Support folder

Specify function boundaries of systems

Subsystems
rtwdemo_atomic
rtwdemo_ssreuse
rtwdemo_filepart
rtwdemo_export_functions

Specify components and boundaries for design and incremental code generation

Model Architecture and Designrtwdemo_mdlreftop

Specify function interfaces so that external software can compile, build, and invoke the generated code

Embedded Coder

Function Prototype Control and C++ Encapsulation Interface Control in the Embedded Coder documentation

rtwdemo_fcnprotoctrl
rtwdemo_cppencap

Manage data packaging in generated code for integrating and packaging data

Embedded Coder

Data, Function, and File Definition in the Embedded Coder documentation

Relocate Code to Another Development Environment (PacknGo)

rtwdemos, select Function, File and Data Packaging folder

Generate and control the format of comments and identifiers in generated code

Embedded Coder

Configure Code Comments in Embedded System Code and Configure Symbols in the Embedded Coder documentation

rtwdemo_comments
rtwdemo_symbols

Create a zip file that contains generated code files, static files, and dependent data to build generated code in an environment other than your host computer

Relocate Code to Another Development Environment (PacknGo) rtwdemo_buildinfo

Export models for validation in a system simulator using shared libraries

Embedded Coder

Shared Object Libraries in the Embedded Coder documentation

rtwdemo_shrlib

Refine component and environment model designs by rapidly iterating between algorithm design and prototyping

Verify whether a component can adequately control a physical system in non-real time

Evaluate system performance before laying out hardware, coding production software, or committing to a fixed design

Test hardware

Real-Time System Rapid Prototyping

Model Architecture and Design in the Simulink Coder documentation

Model Architecture and Design in the Embedded Coder documentation

Code Execution Profiling

rtwdemo_profile

Generate code for rapid prototyping

Targets and Code Formats

Embedded Coder

Model Architecture and Design in the Embedded Coder documentation

Working with Wind River VxWorks RTOS

rtwdemo_counter
rtwdemo_async
Generate code for rapid prototyping in hard real time, using PCs

xPC Target

xPC Target documentation

doc xpcdemos
Generate code for rapid prototyping in soft real time, using PCs

Real-Time Windows Target™

Real-Time Windows Target documentation

rtvdp (and others)

Developing a Detailed Software Design

GoalsRelated Product InformationDemos
Refine a model design for representation and storage of data in generated code

Data, Function, and File Definition

Relocate Code to Another Development Environment (PacknGo)

 

Select a deployment code format

Targets and Code Formats

Embedded Coder

Model Architecture and Design and Code Generation for AUTOSAR Software Components in the Embedded Coder documentation

Working with Wind River VxWorks RTOS

rtwdemo_counter
rtwdemo_async
rtwdemo_osek
AUTOSAR Demos in the Embedded Coder documentation
Specify target hardware settingsTargetrtwdemo_targetsettings
Design model variantsModeling Variant Systems in the Simulink documentation 
Specify fixed-point algorithms in Simulink, Stateflow, and the MATLAB language subset for code generation

Simulink Fixed Point

Data Types and Scaling and Code Generation in the Simulink Fixed Point documentation

rtwdemo_fixpt1
rtwdemo_fuelsys_fxp_publish
Convert a floating-point model or subsystem to a fixed-point representation

Simulink Fixed Point

Fixed-Point Advisor in the Simulink Fixed Point documentation

fxpdemo_fpa
Iterate to obtain an optimal fixed-point design, using autoscaling

Simulink Fixed Point

Automatic Data Typing in the Simulink Fixed Point documentation

fxpdemo_feedback
Create or rename data types specifically for your application

Embedded Coder

Code Generation with User-Defined Data Types in the Embedded Coder documentation

rtwdemo_udt
Control the format of identifiers in generated code

Embedded Coder

Configure Symbols in the Embedded Coder documentation

rtwdemo_symbols
Specify how signals, tunable parameters, block states, and data objects are declared, stored, and represented in generated code

Embedded Coder

Custom Storage Classes in the Embedded Coder documentation

rtwdemo_cscpredef
Create a data dictionary for a model

Embedded Coder

Data Definition and Declaration Management in the Embedded Coder documentation

rtwdemo_advsc
Relocate data segments for generated functions and data using #pragmas for calibration or safe data access

Embedded Coder

Memory Sections in the Embedded Coder documentation

rtwdemo_memsec
Assess and adjust model configuration parameters based on the application and an expected run-time environment

Code Generation in the Simulink Coder documentation

Code Generation in the Embedded Coder documentation

rtwdemo_f14
Check a model against basic modeling guidelinesConsulting the Model Advisor in the Simulink documentationrtwdemo_advisor1
Add custom checks to the Simulink Model Advisor

Simulink Verification and Validation

Customizing the Model Advisor in the Simulink Verification and Validation documentation

slvnvdemo_mdladv
Check a model against custom standards or guidelinesConsulting the Model Advisor in the Simulink documentation  
Check a model against industry standards and guidelines (MathWorks Automotive Advisory Board (MAAB), IEC 61508, and DO-178B)

Embedded Coder

Guidelines and Standards in the Embedded Coder documentation

Simulink Verification and Validation

Model Advisor Checks in the Simulink Verification and Validation documentation

rtwdemo_iec61508
Obtain model coverage for structural coverage analysis such as MC/DC

Simulink Verification and Validation

Model Coverage Analysis in the Simulink Verification and Validation documentation

cvbasic_operation
Prove properties and generate test vectors for models

Simulink Design Verifier™

Simulink Design Verifier documentation

sldvdemo_cruise_control
sldvdemo_cruise_control_verification
Generate reports of models and software designs

MATLAB Report Generator

MATLAB Report Generator documentation

Simulink Report Generator

Simulink Report Generator System Design Description Report documentation

rtwdemo_codegenrpt
Conduct reviews of your model and software designs with coworkers, customers, and suppliers who do not have Simulink available

Simulink Report Generator

Export Simulink Models to Web Views and Comparing XML Files Exported from Simulink Models in the Simulink Report Generator documentation

slxml_sfcar

Refine the concept model of your component or system

Test and validate the model functionality in real time

Test the hardware

Obtain real-time profiles and code metrics for analysis and sizing based on your embedded processor

Assess the feasibility of the algorithm based on integration with the environment or plant hardware

Real-Time System Rapid Prototyping in the Embedded Coder documentation

Embedded IDEs and Embedded Targets topics in the Embedded Coder documentation

Desktop IDEs and Desktop Targets topics in the Simulink Coder documentation

rtwdemos, select Desktop IDEsDesktop TargetsEmbedded IDEsEmbedded Targets folder
Generate source code for your models, integrate the code into your production build environment, and run it on existing hardware

Targets and Code Formats

Embedded Coder

Model Architecture and Design and Code Generation for AUTOSAR Software Components in the Embedded Coder documentation

Working with Wind River VxWorks RTOS

rtwdemo_counter
rtwdemo_fcnprotoctrl
rtwdemo_cppencap
rtwdemo_async
rtwdemo_osek
AUTOSAR Demos in the Embedded Coder documentation
Integrate existing externally written C or C++ code with your model for simulation and code generation

Integrating Existing C Functions into Simulink Models with the Legacy Code Tool in the Simulink documentation

Insert S-Function Code in the Simulink Coder documentation

External Code Integration in the Embedded Coder documentation

rtwdemos, select Integrating with C Code or Integrating with C++ Code folder
Generate code for on-target rapid prototyping on specific embedded microprocessors and IDEs

Real-Time System Rapid Prototyping in the Embedded Coder documentation

Embedded IDEs and Embedded Targets topics in the Embedded Coder documentation

Desktop IDEs and Desktop Targets topics in the Simulink Coder documentation

In rtwdemos, select one of the following folders: Desktop IDEs, Desktop Targets, Embedded IDEs, or Embedded Targets

Generating the Application Code

GoalsRelated Product InformationDemos
Optimize generated ANSI® C code for production (for example, disable floating-point code, remove termination and error handling code, and combine code entry points into single functions)

Performance

Embedded Coder

Performance in the Embedded Coder documentation

rtwdemos, select Optimizations folder
Optimize code for a specific run-time environment, using specialized function libraries

Embedded Coder

Code Replacement in the Embedded Coder documentation

rtwdemo_crl_script
Control the format and style of generated code

Embedded Coder

Control Code Style in the Embedded Coder documentation

rtwdemo_parentheses
Control the comments inserted into generated code

Embedded Coder

Configure Code Comments in Embedded System Code in the Embedded Coder

rtwdemo_comments
Enter special instructions or tags for postprocessing by third-party tools or processesCustomize Post-Code-Generation Build Processingrtwdemo_buildinfo
Include requirements tags in generated code

Simulink Verification and Validation

Requirements Information in Generated Code in the Simulink Verification and Validation documentation

rtwdemo_requirements
Trace model blocks and subsystems to generated code and vice versa

Embedded Coder

Report Generation, Trace Code to Model Objects Using Hyperlinks,Trace Model Objects to Generated Code, and Guidelines and Standards in the Embedded Coder documentation

rtwdemo_comments
rtwdemo_hyperlinks
Integrate existing externally written code with code generated for a model

Integrating Existing C Functions into Simulink Models with the Legacy Code Tool in the Simulink documentation

Insert S-Function Code in the Simulink Coder documentation

External Code Integration in the Embedded Coder documentation

rtwdemos, select Integrating with C Code or Integrating with C++ Code folder
Verify generated code for MISRA C®[a] and other run-time violations

Embedded Coder

Develop Models and Code That Comply with MISRA C Guidelines in the Embedded Coder documentation

Documentation for Polyspace® Products

rtwdemo_polyspace

Protect the intellectual property of component model design and generated code

Generate a binary file (shared library)

Protecting Referenced Models in the Simulink documentation

Shared Object Libraries in the Embedded Coder documentation

 
Generate a MEX-file S-function for a model or subsystem so that it can be shared with a third-party vendorGenerated S-Function Block 
Generate a shared library for a model or subsystem so that it can be shared with a third-party vendorShared Object Libraries in the Embedded Coder documentation 
Test generated production code with an environment or plant model to verify a successful conversion of the model to code

Embedded Coder

Numerical Equivalence Checking in the Embedded Coder documentation

rtwdemo_sil_pil_script
Write or generate an S-function wrapper for calling your generated source code from a model running in Simulink

Write Wrapper S-Functions

Embedded Coder

Generate S-Function Wrappers in the Embedded Coder documentation

rtwdemo_sil_pil_script
Set up and run SIL tests on your host computer

Embedded Coder

Numerical Equivalence Checking in the Embedded Coder documentation

rtwdemo_sil_pil_script

[a] MISRA® and MISRA C are registered trademarks of MISRA Ltd., held on behalf of the MISRA Consortium.

Integrating and Verifying Software

GoalsRelated Product InformationDemos
Integrate existing externally written C or C++ code with a model for simulation and code generation

Integrating Existing C Functions into Simulink Models with the Legacy Code Tool in the Simulink documentation

Insert S-Function Code in the Simulink Coder documentation

External Code Integration in the Embedded Coder documentation

rtwdemos, select Integrating with C Code or Integrating with C++ Code folder
Connect to data interfaces for generated C code data structures

Customization in the Simulink Coder documentation

Deployment in the Embedded Coder documentation

rtwdemo_capi
rtwdemo_asap2
Control the generation of code interfaces so that external software can compile, build, and invoke the generated code

Embedded Coder

Function Prototype Control and C++ Encapsulation Interface Control in the Embedded Coder documentation

rtwdemo_fcnprotoctrl
rtwdemo_cppencap
Export virtual and function-call subsystems

Embedded Coder

Export Function-Call Subsystems in the Embedded Coder documentation

rtwdemo_export_functions
Include target-specific code

Embedded Coder

Code Replacement in the Embedded Coder documentation

rtwdemo_crl_script
Customize and control the build processProgram Building, Interaction, and Debuggingrtwdemo_buildinfo

Create a zip file that contains generated code files, static files, and dependent data to build the generated code in an environment other than your host computer

Relocate Code to Another Development Environment (PacknGo)rtwdemo_buildinfo
Integrate all software components as a complete system for testing in the target environmentComponent Verification in the Embedded Coder documentation 
Generate source code for integration with specific production environments

Targets and Code Formats

Embedded Coder

Model Architecture and Design and Code Generation for AUTOSAR Software Components in the Embedded Coder documentation

Working with Wind River VxWorks RTOS

rtwdemo_async
rtwdemo_osek
AUTOSAR Demos in the Embedded Coder documentation
Integrate code for a specific run-time environment, using specialized function libraries

Embedded Coder

Code Replacement in the Embedded Coder documentation

rtwdemo_crl_script
Enter special instructions or tags for postprocessing by third-party tools or processesCustomize Post-Code-Generation Build Processingrtwdemo_buildinfo
Integrate existing externally written code with code generated for a model

Integrating Existing C Functions into Simulink Models with the Legacy Code Tool in the Simulink documentation

Insert S-Function Code in the Simulink Coder documentation

External Code Integration in the Embedded Coder documentation

rtwdemos, select Integrating with C Code or Integrating with C++ Code folder
Connect to data interfaces for the generated C code data structures

Customization in the Simulink Coder documentation

Deployment in the Embedded Coder documentation

rtwdemo_capi
rtwdemo_asap2
Customize and control the build processProgram Building, Interaction, and Debuggingrtwdemo_buildinfo

Create a zip file that contains generated code files, static files, and dependent data needed to build the generated code in an environment other than your host computer

Relocate Code to Another Development Environment (PacknGo)rtwdemo_buildinfo

Schedule the generated code

Scheduling

rtwdemos, select Multirate Support folder

Verify object code files in a target environment

Numerical Equivalence Checking in the Embedded Coder documentationrtwdemo_sil_pil_script
Set up and run PIL tests on your target system

Numerical Equivalence Checking in the Embedded Coder documentation

Embedded IDEs and Embedded Targets topics in the Embedded Coder documentation

rtwdemo_sil_pil_script
rtwdemo_custom_pil
rtwdemo_rtiostream
See the list of supported hardware for the Embedded Coder product on the MathWorks Web site, and then find a demo for the related product of interest

Integrating, Verifying, and Calibrating System Components

GoalsRelated Product InformationDemos

Integrate the software and its microprocessor with the hardware environment for the final embedded system product

Add the complexity of the environment (or plant) under control to the test platform

Test and verify the embedded system or control unit by using a real-time target environment

Hardware-In-the-Loop (HIL) Simulation 
Generate source code for HIL testing

Targets and Code Formats

Embedded Coder

Model Architecture and Design and Code Generation for AUTOSAR Software Components in the Embedded Coder documentation

Working with Wind River VxWorks RTOS

rtwdemo_f14
Conduct hard real-time HIL testing using PCs

xPC Target

xPC Target documentation

doc xpcdemos

Tune ECU properly for its intended use

Customization in the Simulink Coder documentation

Deployment in the Embedded Coder documentation

 
Generate ASAP2 data filesASAP2 Data Measurement and Calibrationrtwdemo_asap2
Generate C API data interface filesData Interchange Using the C APIrtwdemo_capi


[a] MISRA® and MISRA C are registered trademarks of MISRA Ltd., held on behalf of the MISRA Consortium.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS