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.

Functions

expand all

simSimulate a Simulink model
cvtestCreate model coverage test specification object
cvsimSimulate and return model coverage results for test objects
cvdataAccess Simulink Coverage data in the MATLAB workspace
cvexitExit model 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
slvnvruncgvtestInvoke Code Generation Verification (CGV) API and execute model
slvnvruntestoptsGenerate simulation or execution options for slvnvruntest or slvnvruncgvtest
slvnvextractExtract atomic subsystem or subchart contents into new model

Topics

Types of Model Coverage

Model coverage metrics provided by Simulink Coverage.

Use Simulink Coverage to Analyze Your Model

Learn the basic Simulink Coverage workflow.

Specify Coverage Options

In the model settings, specify several coverage analysis options.

Model Objects That Receive Coverage

Model objects that receive model coverage during simulation.

Model Objects That Do Not Receive Coverage

Simulink objects that do not receive coverage.

Modified Condition and Decision Coverage (MCDC) Definitions in Simulink Coverage

Describes the definitions of MCDC coverage available for use in Simulink Coverage.

Modified Condition and Decision Coverage in Simulink Design Verifier

Describes the difference between MCDC coverage in Simulink Design Verifier™ and in Simulink Coverage.

Simulink Optimizations and Model Coverage

Learn how inlined parameters, block reduction, and conditional input branch execution can affect your model coverage data.

Model Coverage for Multiple Instances of a Referenced Model

Collect model coverage when a model has multiple Model blocks that reference the same model.

Model Coverage for Stateflow Charts

Describes the definition of coverage for elements in Stateflow charts.

Featured Examples