Main Content

Collect Coverage for Models

Measure coverage for models, identify untested elements of your design

Collect coverage during simulation to measure which elements in your model or Stateflow® charts are tested. Simulink® Coverage™ measures several types of coverage, such as execution, decision, condition, and modified condition/decision coverage. The most basic coverage level determines whether an item executes during simulation, while more extensive coverage levels determine whether individual logical conditions are fully exercised and independently affect the output of logical expressions.


expand all

simRun and script programmatic simulations of Simulink models
cvtestCreate model coverage test specification object
cvsimSimulate and return model coverage results for test objects
cvdataAccess Simulink Coverage data in the MATLAB workspace
cvexitExit coverage environment
parsimSimulate dynamic system multiple times in parallel or serial
slvnvlogsignalsLog test data for component or model during simulation
slvnvmergedataCombine test data from data files
slvnvmakeharnessGenerate Simulink Coverage harness model
slvnvharnessoptsGenerate default options for slvnvmakeharness
slvnvmergeharnessCombine test data from harness models
slvnvruntestSimulate model by using input data
slvnvruncgvtestUse Code Generation Verification (CGV) API to execute model
slvnvruntestoptsGenerate simulation or execution options for slvnvruntest or slvnvruncgvtest
slvnvextractExtract atomic subsystem or subchart contents into new model

Model Settings

expand all

Enable coverage analysisAnalyze coverage
Scope of coverage analysisSet scope of coverage analysis
Select ModelsSelect models to include in coverage analysis
Select SubsystemSelect subsystem to include in coverage analysis
Include in analysis: MATLAB filesEnable coverage for external MATLAB files
Include in analysis: C/C++ S-functionsAnalyze coverage for C/C++ S-Function blocks
Structural coverage levelTypes of coverage to analyze
Lookup tableEnable lookup table coverage
Signal rangeEnable signal range coverage
Signal sizeEnable signal size coverage
Objectives and constraintsEnable objectives and constraints coverage
Saturation on integer overflowEnable saturation on integer overflow coverage
Relational boundaryEnable relational boundary coverage
Relational boundary coverage absolute toleranceRelational boundary coverage absolute tolerance
Relational boundary coverage relative toleranceRelational boundary coverage relative tolerance
Restrict coverage recording intervalAnalyze coverage during a specific time interval
Coverage interval start timeSimulation time to begin coverage analysis
Coverage interval stop timeSimulation time to stop coverage analysis
Force block reduction offAnalyze coverage for every supported block in model
Treat Simulink logic blocks as short-circuitedUse logical short-circuiting during coverage analysis
MCDC modeModified condition decision coverage analysis mode
Warn when unsupported blocks exist in modelDisplay a warning if Simulink Coverage detects unsupported blocks
Coverage metric settingsCoverage metrics to analyze
Record coverage for this modelRecord coverage during simulation
Record coverage for referenced modelsAnalyze coverage for referenced models
Include top modelInclude top-level model in coverage analysis
Exclude inactive choices of variantsExclude inactive choices of variants (Since R2022a)
Update coverage results on pauseUpdate coverage results on pause
Save output dataSave coverage data results to file


Model Coverage Definitions

Using Model Coverage

Model Coverage for Stateflow Charts