Collect Model Coverage Data

Measure model coverage to indicate untested elements of your design during simulation

Simulink® Coverage™ measures model coverage and code coverage to indicate untested elements of your design, such as logical conditions, unintended functionality, and switch positions during simulation. Review coverage information for the model in generated reports and in highlighted models to identify missing coverage and navigate to the associated requirements. Determine if you need to modify the requirements, test cases, or design to meet your coverage goals.

Functions

cvtestCreate model coverage test specification object
cvsimSimulate and return model coverage results for test objects
cvhtmlProduce HTML report from model coverage objects
cvmodelviewDisplay model coverage results with model coloring
executioninfoRetrieve execution coverage information from cvdata object
conditioninfoRetrieve condition coverage information from cvdata object
decisioninfoRetrieve decision coverage information from cvdata object
mcdcinfoRetrieve modified condition/decision coverage information from cvdata object

Topics

Model Coverage Basics

Model Coverage

Validate your model tests by measuring how thoroughly the model objects are tested.

Simulink Coverage in End-to-End Systematic Verification

Learn how Simulink Coverage helps you to increase confidence in your design through end-to-end systematic verification.

Specify Coverage Options

In the Simulink Editor, specify several coverage recording options.

Coverage Settings

Specify the Simulink Coverage analysis options.

Types of Model Coverage

Model coverage metrics provided by Simulink Coverage.

View Coverage Results in a Model

Highlight model elements to view coverage results.

Obtain Cumulative Coverage for Reusable Subsystems and Stateflow® Constructs

Create and view cumulative coverage results for a model with a reusable subsystem.

Cumulative Coverage Data

Collect cumulative model coverage from successive simulation runs.

Create and Run Test Cases

Create and run test cases by using the model coverage MATLAB® commands cvtest and cvsim.

Coverage for Custom C/C++ Code in Simulink Models

Analyze model coverage for C/C++ S-Functions.

Model Coverage Object Details

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

Describes the definitions of MCDC coverage used 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.

Logical Operator Cascade Patterns

This model includes various patterns of cascaded Logical Operator blocks.

Analyzing MCDC for Cascaded Logic Blocks

This example illustrates how Simulink® Coverage™ records the MCDC metric for a cascade of Logical Operator blocks.

Simulink Optimizations and Model Coverage

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

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.

Model Coverage for MATLAB Functions

Use model coverage for MATLAB Function blocks and interpret the results.

Model Coverage for Stateflow Charts

Determine the extent to which a model test case exercises simulation control flow paths through a model.

Model Coverage for Multiple Instances of a Referenced Model

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

Coverage for MATLAB® Function Blocks

This example model explains how Model Coverage relates to MATLAB code inside a MATLAB Function Block.

Coverage for S-Functions

This example shows how to configure an S-Function generated with the Legacy Code Tool to be compatible with coverage.

Saturation on Integer Overflow Coverage

Simulate this model to collect and report Saturate on integer overflow coverage.

Featured Examples