Coverage Settings

Coverage Pane Overview

Specify the Simulink® Coverage™ analysis options.

Enable coverage analysis

Enable coverage analysis. See Specify Coverage Options.

Settings

On

Coverage data is collected during simulation.

Off (default)

Coverage data is not collected during simulation.

Command-Line Information

Parameter: CovEnable
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Scope of coverage analysis

Specify whether the analysis must collect coverage data for the entire system, or a specific referenced model or subsystem.

Settings

Entire System (default)

Coverage data is collected for the top-level model, as well as all supported subsystems and model references.

Referenced Models

Coverage data is collected for one or more referenced models. To specify the referenced models, use the parameter Select Models. You can also specify the top-level model itself.

Subsystem

Coverage data is collected for a specific subsystem. To specify a subsystem, use the parameter Select Subsystem.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovScope
Type: Character vector or string
Value: 'EntireSystem' | 'ReferencedModels' | 'Subsystem'
Default: 'EntireSystem'

Select Models

Specify the referenced models for which you want coverage.

Settings

In the Select Models for Coverage Analysis dialog box, select the referenced models for which you want coverage. You can also select the top-level model. The icon next to the model name indicates the simulation mode: Normal, SIL, or PIL.

Dependency

To enable this parameter, select:

Command-Line Information

Note

Unlike in the user interface, on the command line, you exclude models from coverage instead of including them.

Parameter: CovModelRefExcluded
Type: Character vector or string
Value: Comma-separated list of model names, for instance, 'mRefA, mRefB, mRefC'. If the same model is referenced in two simulation modes, you can distinguish between them using :, for instance, 'mRefA:normal, mRefA:sil'.
Default: ''

Select Subsystem

Specify the path to the subsystem for which Simulink Coverage collects coverage data. Specify the path relative to the top model.

Settings

Select the subsystem for which you want coverage.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovPath
Type: Character vector or string
Value: Path to subsystem relative to (and excluding) the top-level Simulink system, for instance, 'Subsys1/subsys2'
Default: '/'. Coverage data is reported for the entire system.

Record coverage for MATLAB files

Enable coverage for MATLAB® functions in external MATLAB files. The functions can be invoked from MATLAB Function blocks or Stateflow® charts in your model. See Model Coverage for MATLAB Functions.

Settings

On (default)

Coverage data is collected for MATLAB functions in external MATLAB files. The functions can be called from MATLAB Function blocks or Stateflow charts in the model.

Off

Coverage data is not collected for external MATLAB files.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovExternalEMLEnable
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Record coverage for C/C++ S-functions

Enable coverage for C/C++ code in S-Function blocks in your model. See also Coverage for Custom C/C++ Code in Simulink Models.

Settings

On (default)

Coverage data is collected for C/C++ code in S-Function blocks in the model.

Off

Coverage data is not collected for C/C++ code used in the model.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovSFcnEnable
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Structural coverage level

Select the type of coverage data collected. See also Types of Model Coverage.

Settings

Decision (default)

The analysis computes decision coverage during simulation

Decision coverage analysis checks blocks that perform an action based on whether an operation evaluates to true or false. For instance, the Abs block first evaluates if the input is less than zero and acts accordingly. For each operation that can evaluate to true or false, the analysis reports what fraction of the outcomes was true during simulation and what fraction was false.

See Decision Coverage (DC).

Condition/Decision

The analysis computes condition and decision coverage during simulation.

Condition coverage analysis checks blocks that output a logical combination of their inputs (such as Logical Operator blocks). For each block, the analysis records what fraction of the inputs was true during simulation and what fraction was false.

See Condition Coverage (CC).

Modified Condition/Decision Coverage (MCDC)

The analysis computes Modified Condition/Decision Coverage (MCDC) during simulation.

See Modified Condition/Decision Coverage (MCDC).

Block Execution

The analysis checks if each block executes at least once during simulation.

See Execution Coverage (EC).

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovMetricStructuralLevel
Type: Character vector or string
Value: 'BlockExecution' | 'ConditionDecision' | 'Decision' | 'MCDC'
Default: 'Decision'

Lookup table

Enable lookup table coverage. See Types of Model Coverage.

Settings

On

Blocks with lookup tables are checked for coverage. A test case achieves full coverage of a lookup table if it executes each interval of the table at least once.

Off (default)

Lookup table coverage is not recorded.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovMetricLookupTable
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Signal range

Enable signal range coverage. See Types of Model Coverage.

Settings

On

Maximum and minimum signal values are recorded for each block that has an output signal.

Off (default)

Signal range information is not recorded.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovMetricSignalRange
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Signal size

Enable signal size coverage. See Types of Model Coverage.

Settings

On

Maximum, minimum and allocated signal size are recorded for each block that has a variable-size output signal. See Variable-Size Signal Basics.

Off (default)

Signal size information is not recorded.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovMetricSignalSize
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Objectives and constraints

Enable coverage of objectives and constraints specified in Simulink Design Verifier™ blocks. See Types of Model Coverage.

Settings

On

Through Simulink Design Verifier blocks, you can specify objectives and constraints in your model. To check if these objectives are satisfied, you first generate test cases using these blocks. You can execute these test cases on the original model and record whether the specified objective was satisfied at least once. To record this coverage, enable this parameter.

For an example, see Simulink Design Verifier Coverage.

Off (default)

Coverage information is not recorded for Simulink Design Verifier blocks.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovMetricObjectiveConstraint
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Saturation on integer overflow

Enable saturation on integer overflow coverage. See Types of Model Coverage.

Settings

On

For certain blocks, such as the Abs block, you can specify that they must saturate on integer overflow. If you enable this parameter, the number of times these blocks saturate during simulation is recorded.

Off (default)

Saturation on integer overflow information is not recorded.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovMetricSaturateOnIntegerOverflow
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Relational boundary

Enable relational boundary coverage. See Types of Model Coverage.

Settings

On

Certain blocks such as the Relational Operator or If block use a relational operation. If you enable this parameter, the coverage analysis checks if these operations are executed with equal (integer) or almost equal (floating-point) values.

Off (default)

Relational boundary coverage information is not recorded.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovMetricRelationalBoundary
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Relational boundary coverage absolute tolerance

Specify the value of absolute tolerance for relational boundary coverage. See Relational Boundary Coverage.

Settings

Enter a floating-point value. See Floating-Point Numbers.

Relational boundary coverage checks blocks with relational operations (such as the Relational Operator block). The analysis checks if the operations are executed with floating-point operands that differ by at most this value.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovBoundaryAbsTol
Type: Floating-point number
Value: Absolute tolerance value such as 1e-06
Default: 1e-05

Relational boundary coverage relative tolerance

Specify the value of relative tolerance for relational boundary coverage. See Relational Boundary Coverage.

Settings

Enter a number less than 1.

Relational boundary coverage checks blocks with relational operations (such as the Relational Operator block). The analysis checks if the operations are executed with floating-point operands that differ by at most this fraction of the operands.

For instance, if you enter 0.01, the analysis checks if an operation lhs < = rhs in your model is executed with operands that differ by at most:

0.01 * max(|lhs|,|rhs|)

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovBoundaryRelTol
Type: Floating-point number
Value: Relative tolerance value such as 0.001
Default: 0.01

Save last run in workspace variable

Save the coverage data from simulation in a MATLAB variable.

You can retrieve coverage information from this variable later. For instance, to retrieve decision coverage information, use the decisioninfo function. For the full list of functions, see Automate Coverage Workflows.

Settings

On

Coverage data is stored in a cvdata object in the MATLAB workspace. Specify the object name using the parameter Last coverage run variable name. Choose to create a new object for each simulation using the parameter Increment variable name with each simulation.

Off (default)

Coverage data is not stored in a MATLAB variable.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovSaveSingleToWorkspaceVar
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Last coverage run variable name

Specify a name for the cvdata object that contains coverage results from the last simulation.

Settings

Enter a name, for instance, coverageData.

If you want a new variable to store coverage results for each simulation, use the parameter Increment variable name with each simulation. The new variable name is created by appending a counter value to the original name, for instance, coverageData1, coverageData2, and so on.

The default variable name is covdata.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovSaveName
Type: Character vector or string
Value: Name to be given to cvdata object
Default: 'covdata'

Increment variable name with each simulation

Create a new variable to store coverage results for each new simulation.

Settings

On

A new cvdata object stores coverage results for each simulation.

The new variable name is created by appending a counter value to the original variable name from the first simulation. Specify the original variable name using the parameter Last coverage run variable name.

Off (default)

Each new simulation overwrites the coverage results from the previous simulation. A single cvdata object stores the coverage results from the most recent simulation.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovNameIncrementing
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Autosave data file name

Specify name of .cvt file to which coverage data is automatically saved.

Settings

Enter file name. The default name is $ModelName$_cvdata, where $ModelName$ is the model name.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovDataFileName
Type: Character vector or string
Value: Name to be given to .cvt file
Default: '$ModelName$_cvdata'

Output directory

Specify a folder in which coverage output files are saved.

Settings

Enter path to folder. You can enter the absolute path or path relative to the current working folder.

By default, the files are saved in a subfolder slcov_output/$ModelName$ relative to the current working folder. Here $ModelName$ is the model name.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovOutputDir
Type: Character vector or string
Value: Path to folder
Default: 'slcov_output/$ModelName$'

Restrict coverage recording interval

Record coverage only for a specified time interval.

For instance, you might want to restrict model coverage recording if your model has transient effects early in simulation, or if you need model coverage reported only for a particular model operation.

Settings

On

Coverage is recorded only for the time interval that you specify. To specify a time interval, use these parameters:

Off (default)

Coverage is recorded for the entire duration of simulation.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovUseTimeInterval
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Coverage interval start time

Specify when coverage data collection must begin.

Settings

Enter a time value (in seconds).

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovStartTime
Type: Floating-point number
Value: Time in seconds, for instance, 2
Default: 0

Coverage interval stop time

Specify when coverage data collection must end.

Settings

Enter a time value (in seconds).

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovStopTime
Type: Floating-point number
Value: Time in seconds, for instance, 4
Default: 0

Force block reduction off

Report coverage for every block in the model that is supported for coverage.

Settings

On (default)

Coverage is recorded for every supported block in the model. The value of the configuration parameter Block reduction is ignored. See Block reduction.

Off

Coverage is not recorded for blocks that are effectively removed from the model because of block reduction. For instance, coverage is not recorded for a block that is reduced by dead code elimination.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovForceBlockReductionOff
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Treat Simulink logic blocks as short-circuited

Specify that coverage must take into account the order of operands in blocks that perform a logical operation, for instance, Logical operator blocks.

For instance, if the order of the two inputs to a Logical AND block is taken into account, the second input is redundant when the first input is false. Therefore, for cases where the first input is false, the paths that lead to the second input are not considered for coverage.

Settings

On

Coverage analysis does not consider the input to a logical operation that is rendered redundant by another input.

Off (default)

Coverage analysis considers all inputs to a logical operation.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovLogicBlockShortCircuit
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

MCDC mode

Specify the definition of Modified Condition/Decision Coverage (MCDC) to use during coverage analysis. See Modified Condition and Decision Coverage (MCDC) Definitions in Simulink Coverage.

Settings

Masking

Use masking MCDC analysis. To establish the independence of inputs, masking MCDC analysis does not require that all other inputs be strictly held constant while one input is varied. Therefore, masking MCDC analysis allows you to satisfy greater number of objectives in a given simulation.

Unique-Cause

Use unique-cause MCDC analysis.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovMcdcMode
Type: Character vector or string
Value: 'Masking'|'UniqueCause'
Default: 'Masking'

Warn when unsupported blocks exist in model

Warn when unsupported blocks exist in model.

Settings

On (default)

Provide a warning when blocks in the model are not supported for coverage analysis.

Off

Do not provide a warning for unsupported blocks.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovUnsupportedBlockWarning
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Coverage filter filename

Specify a filter file to exclude certain model objects from coverage analysis during simulation.

You can use a command-line API to create filtering rules for blocks. Selection criteria for filtering includes filtering by individual block ID, filtering for all blocks of the same type, filtering certain decisions, conditions, and outcomes of a block, and more. You can also filter S-Function C++ code by code coverage outcome.

For an example of filtering, see:

Settings

Enter full path to .cvf file with filter rules.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovFilter
Type: Character vector or string
Value: Full path to .cvf file
Default:

Coverage metric settings

Specify the type of coverage metric to be recorded. See also Types of Model Coverage.

Settings

Enter a sequence of letters that describe the coverage metric types. For instance, the sequence dc indicates that the decision and condition coverage must be recorded.

The coverage metric types are:

  • d: Decision coverage

  • c: Condition coverage

  • m: MCDC coverage

  • t: Lookup table coverage

  • r: Signal range coverage

  • o: Coverage for Simulink Design Verifier blocks

  • b: Relational boundary coverage

  • r: Signal range coverage

Additionally, you can use these letters. The letters correspond to other parameters.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovMetricSettings
Value: Character vector or string where each character signifies a coverage metric. For instance, 'dc' specifies decision and condition coverage.
Default: 'dwe'

Record coverage for this model

Record model coverage data during simulation.

Note

This parameter represents a deprecated workflow. Instead use these parameters:

Settings

On (default)

Simulink collects model coverage data during simulation.

Off

Model coverage data is not collected or reported.

Command-Line Information

Parameter: RecordCoverage
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Record coverage for referenced models

Record coverage data for referenced models during simulation.

Note

This parameter represents a deprecated workflow. Instead use these parameters:

Settings

Enter one of these:

  • on: Coverage data is collected for all referenced models.

  • off: Coverage data is not collected for referenced models.

  • filtered: Coverage data is collected for all referenced models except those excluded using the parameter Select Models.

Command-Line Information

Parameter: CovModelRefEnable
Type: Character vector or string
Value: 'on'|'off'|'filtered'
Default: 'off'

Include top model

Record coverage for the top-level model in addition to referenced models.

Note

This parameter represents a deprecated workflow. Instead use these parameters:

Settings

On (default)

Coverage data is collected for the top-level model.

Off

Coverage data is not collected for the top-level model.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovIncludeTopModel
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Coverage report options

Specify the formatting of certain aspects of the coverage report (HTML).

Note

For an easier way to specify report formatting, see Report from Results Explorer.

Settings

Enter a space-separated list of flags. The available flags are:

  • '-sRT=0' — Do not show report

  • '-sVT=1' — Open a web view of the report in a browser. See also Export Model Coverage Web View.

  • '-aTS=1' — Show each test in the model summary.

  • '-bRG=1' — Show bar graphs in the model summary.

  • '-bTC=1' — Use two color bar graphs (red, blue).

  • '-hTR=1' — Display hit/count ratio in the model summary.

  • '-nFC=0' — Do not report fully covered model objects

  • '-scm=1' — Include cyclomatic complexity numbers in summary. See also Cyclomatic Complexity.

  • '-bcm=1' — Include cyclomatic complexity numbers in block details.

  • '-xEv=0' — Filter Stateflow events from report.

  • '-agT=1' — Show aggregated tests information in coverage report.

  • '-req=1' — Include linked requirements in aggregated coverage report.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovHTMLOptions
Type: Character vector or string
Value:
Default:

Additional data to include in coverage report

Include additional model coverage data from cvdata objects in the model coverage report.

Settings

Enter the name of a cvdata object associated with a simulation.

You get a cvdata object when you record coverage and save coverage data in a workspace variable. See:

You also get a cvdata object if you run simulation using the cvsim function. See cvsim.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovCompData
Type: Character vector or string
Value: Name of cvdata object.
Default: No default

Update coverage results on pause

Update coverage report when you pause during simulation. The report is updated with coverage results up to the current pause or stop time.

Settings

On (default)

Coverage report is updated when you pause simulation.

Off

Coverage report is not updated when you pause simulation.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovReportOnPause
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Save output data

Save coverage data results to a file.

Settings

On (default)

Coverage data results are saved to a file. Specify the file name using the parameter Autosave data file name.

Off

Coverage data results are not saved to a file.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovSaveOutputData
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Enable cumulative data collection

Collect model coverage results from successive simulations. See also Cumulative Coverage Data.

Note

For an easier way to accumulate coverage data from multiple simulations, see Accumulating Coverage Data from the Results Explorer.

Settings

On (default)

Model coverage data from successive simulations are collected together.

To show the cumulative data in one report, use the parameter Include cumulative data in coverage report. To save the data in one workspace variable, use the parameters Save cumulative coverage results in workspace variable and Cumulative coverage variable name.

Off

Model coverage data is retained for the most recent simulation only.

Dependency

To enable this parameter, select Enable coverage analysis.

Command-Line Information

Parameter: CovEnableCumulative
Type: Character vector or string
Value: 'on'|'off'
Default: 'on'

Include cumulative data in coverage report

Show model coverage results from successive simulations in a single HTML report.

Note

For an easier way to accumulate coverage data from multiple simulations, see Accumulating Coverage Data from the Results Explorer.

Settings

On

The HTML report shows model coverage data from successive simulations.

Off (default)

The HTML report shows model coverage data from the most recent simulation.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovCumulativeReport
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Save cumulative coverage results in workspace variable

Save model coverage data from successive simulations in a single cvdata object in the MATLAB workspace.

You can retrieve coverage information from this variable later. For instance, to retrieve decision coverage information, use the decisioninfo function. For the full list of functions, see Automate Coverage Workflows.

Note

For an easier way to accumulate coverage data from multiple simulations, see Accumulating Coverage Data from the Results Explorer.

Settings

On

A single cvdata object stores model coverage data from successive simulations. See Cumulative Coverage Data.

Specify the variable name using the parameter Cumulative coverage variable name.

Off (default)

The cvdata object stores model coverage data from the most recent simulation.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovSaveCumulativeToWorkspaceVar
Type: Character vector or string
Value: 'on'|'off'
Default: 'off'

Cumulative coverage variable name

Specify the name of the cvdata object that saves coverage data from successive simulations.

Note

For an easier way to accumulate coverage data from multiple simulations, see Accumulating Coverage Data from the Results Explorer.

Settings

Enter variable name, for instance, cumulativeCoverageData.

Dependency

To enable this parameter, select:

Command-Line Information

Parameter: CovCumulativeVarName
Type: Character vector or string
Value: Name to be given to cvdata object
Default: 'covCumulativeData'