Automate Coverage Workflows

Customize and automate model coverage collection

Model coverage commands let you automate the entire model coverage process with MATLAB® scripts. You can use model coverage commands to set up model coverage tests, execute them in simulation, and store and report the results.


expand all

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 subsystem or subchart contents into new model
slcovmexBuild coverage-compatible MEX-function from C/C++ code
cvtestCreate model coverage test specification object
cvsimSimulate and return model coverage results for test objects
cvexitExit model coverage environment
cvloadLoad coverage tests and stored results into memory
cvsaveSave coverage tests and results to file
cvresultsReturns active coverage data, clears and loads active coverage data from a file
cvmodelviewDisplay model coverage results with model coloring
conditioninfoRetrieve condition coverage information from cvdata object
decisioninfoRetrieve decision coverage information from cvdata object
executioninfoRetrieve execution coverage information from cvdata object
getCoverageInfoRetrieve coverage information for Simulink Design Verifier blocks from cvdata object
mcdcinfoRetrieve modified condition/decision coverage information from cvdata object
complexityinfoRetrieve cyclomatic complexity coverage information from cvdata object
overflowsaturationinfoRetrieve saturation on integer overflow coverage from cvdata object
relationalboundaryinfoRetrieve relational boundary coverage from cvdata object
sigrangeinfoRetrieve signal range coverage information from cvdata object
sigsizeinfoRetrieve signal size coverage information from cvdata object
tableinfoRetrieve lookup table coverage information from cvdata object
extractExtract subsystem coverage data from system-level coverage data
cvhtmlProduce HTML report from model coverage objects
slwebview_covExport Simulink models to Web views with coverage


expand all

cv.cvdatagroupCollection of cvdata objects
slcoverage.BlockSelectorSelect blocks for coverage filter
slcoverage.CodeSelectorSelect custom C/C++ code for coverage filter
slcoverage.FilterCoverage filter set
slcoverage.FilterRuleCreate coverage filtering rule
slcoverage.MetricSelectorSelect metric criterion for coverage filter
slcoverage.SelectorGet selectors of all types
slcoverage.SFcnSelectorSelect S-function criterion for filtering rule


Create Tests with cvtest

Create a test object that specifies the model or part of the model tested.

Run Tests with cvsim

Execute (simulate) the test object. This creates a results object for the test object.

Create HTML Reports with cvhtml

Create a report for the results object.

Save Test Runs to File with cvsave

Save the test object and its results object in a file.

Load Stored Coverage Test Results with cvload

Load the file containing test and results objects to create new reports of model coverage data.

Retrieve Coverage Details from Results

Retrieve specific coverage information after simulation using MATLAB commands.

Use Coverage Commands in a Script

Example script that demonstrates how to use the model coverage commands.

Command Line Verification Tutorial

This example creates three test cases for an adjustable rate limiter and analyzes the resulting model coverage using the command-line API of the Model Coverage tool.

Record Coverage in Parallel Simulations by Using Parsim

This example shows how to record coverage in multiple parallel Simulink® simulations corresponding to different test cases by using SimulationInput objects and the parsim command.