Specify the Simulink® Coverage™ analysis options.
Enable coverage analysis. See Specify Coverage Options.
Coverage data is collected during simulation.
Coverage data is not collected during simulation.
Parameter:
CovEnable |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Specify whether the analysis must collect coverage data for the entire system, or a specific referenced model or subsystem.
Coverage data is collected for the top-level model, as well as all supported subsystems and model references.
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.
Coverage data is collected for a specific subsystem. To specify a subsystem, use the parameter Select Subsystem.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovScope |
Type: Character vector or string |
Value:
'EntireSystem' |
'ReferencedModels' |
'Subsystem' |
Default:
'EntireSystem' |
Specify the referenced models for which you want coverage.
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
.
To enable this parameter, select:
Specify referenced models for Scope of coverage analysis.
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: '' |
Specify the path to the subsystem for which Simulink Coverage collects coverage data. Specify the path relative to the top model.
Select the subsystem for which you want coverage.
To enable this parameter, select:
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. |
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.
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.
Coverage data is not collected for external MATLAB files.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovExternalEMLEnable |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'on' |
Enable coverage for C/C++ code in S-Function blocks in your model. See also Coverage for Custom C/C++ Code in Simulink Models.
Coverage data is collected for C/C++ code in S-Function blocks in the model.
Coverage data is not collected for C/C++ code used in the model.
To enable this parameter, select:
Parameter:
CovSFcnEnable |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'on' |
Select the type of coverage data collected. See also Types of Model Coverage.
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.
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.
The analysis computes Modified Condition/Decision Coverage (MCDC) during simulation.
The analysis checks if each block executes at least once during simulation.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovMetricStructuralLevel |
Type: Character vector or string |
Value:
'BlockExecution' |
'ConditionDecision' | 'Decision' |
'MCDC' |
Default:
'Decision' |
Enable lookup table coverage. See Types of Model Coverage.
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.
Lookup table coverage is not recorded.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovMetricLookupTable |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Enable signal range coverage. See Types of Model Coverage.
Maximum and minimum signal values are recorded for each block that has an output signal.
Signal range information is not recorded.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovMetricSignalRange |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Enable signal size coverage. See Types of Model Coverage.
Maximum, minimum and allocated signal size are recorded for each block that has a variable-size output signal. See Variable-Size Signal Basics (Simulink).
Signal size information is not recorded.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovMetricSignalSize |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Enable coverage of objectives and constraints specified in Simulink Design Verifier™ blocks. See Types of Model Coverage.
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.
Coverage information is not recorded for Simulink Design Verifier blocks.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovMetricObjectiveConstraint |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Enable saturation on integer overflow coverage. See Types of Model Coverage.
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.
Saturation on integer overflow information is not recorded.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovMetricSaturateOnIntegerOverflow |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Enable relational boundary coverage. See Types of Model Coverage.
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.
Relational boundary coverage information is not recorded.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovMetricRelationalBoundary |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Specify the value of absolute tolerance for relational boundary coverage. See Relational Boundary Coverage.
Enter a floating-point value. See Floating-Point Numbers (MATLAB).
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.
To enable this parameter, select:
Parameter:
CovBoundaryAbsTol |
Type: Floating-point number |
Value: Absolute tolerance value such as 1e-06 |
Default: 1e-05 |
Specify the value of relative tolerance for relational boundary coverage. See Relational Boundary Coverage.
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|)
To enable this parameter, select:
Parameter:
CovBoundaryRelTol |
Type: Floating-point number |
Value: Relative tolerance value such as 0.001 |
Default: 0.01 |
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.
Coverage is recorded only for the time interval that you specify. To specify a time interval, use these parameters:
Coverage is recorded for the entire duration of simulation.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovUseTimeInterval |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
Specify when coverage data collection must begin.
Enter a time value (in seconds).
To enable this parameter, select:
Parameter:
CovStartTime |
Type: Floating-point number |
Value: Time in seconds, for instance, 2 |
Default: 0 |
Specify when coverage data collection must end.
Enter a time value (in seconds).
To enable this parameter, select:
Parameter:
CovStopTime |
Type: Floating-point number |
Value: Time in seconds, for instance, 4 |
Default: 0 |
Report coverage for every block in the model that is supported for coverage.
Coverage is recorded for every supported block in the model. The value of the configuration parameter Block reduction is ignored. See Block reduction (Simulink).
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.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovForceBlockReductionOff |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'on' |
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.
Coverage analysis does not consider the input to a logical operation that is rendered redundant by another input.
Coverage analysis considers all inputs to a logical operation.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovLogicBlockShortCircuit |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'off' |
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.
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.
UniqueCause
Use unique-cause MCDC analysis.
To enable this parameter, select:
Specify Modified Condition/Decision Coverage (MCDC) for Structural coverage level.
Parameter:
CovMcdcMode |
Type: Character vector or string |
Value:
'Masking' |'UniqueCause' |
Default:
'Masking' |
Warn when unsupported blocks exist in model.
Provide a warning when blocks in the model are not supported for coverage analysis.
Do not provide a warning for unsupported blocks.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovUnsupportedBlockWarning |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'on' |
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:
User interface: Create, Edit, and View Coverage Filter Rules.
Command line: R2017b release notes for Simulink Coverage.
Enter full path to .cvf
file with filter rules.
To enable this parameter, select Enable coverage analysis.
Parameter:
CovFilter |
Type: Character vector or string |
Value: Full path to
.cvf file |
Default: |
Specify the type of coverage metric to be recorded. See also Types of Model Coverage.
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.
e
: Same result as disabling Display coverage results using model coloring
To enable this parameter, select:
One of these: Record coverage for this model, Record coverage for referenced models (enter
on
) or Record coverage for MATLAB files
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 model coverage data during simulation.
This parameter represents a deprecated workflow. Instead use these parameters:
To enable coverage, use Enable coverage analysis.
To perform coverage analysis for the entire model, use Scope of coverage analysis.
Simulink collects model coverage data during simulation.
Model coverage data is not collected or reported.
Parameter:
RecordCoverage |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'on' |
Record coverage data for referenced models during simulation.
This parameter represents a deprecated workflow. Instead use these parameters:
To enable coverage, use Enable coverage analysis.
To perform coverage analysis for referenced models, use Scope of coverage analysis.
To specify the referenced models, use Select Models.
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.
Parameter:
CovModelRefEnable |
Type: Character vector or string |
Value:
'on' |'off' |'filtered' |
Default:
'off' |
Record coverage for the top-level model in addition to referenced models.
This parameter represents a deprecated workflow. Instead use these parameters:
To enable coverage, use Enable coverage analysis.
To perform coverage analysis for referenced models, use Scope of coverage analysis.
To include or exclude the top-level model, use Select Models.
Coverage data is collected for the top-level model.
Coverage data is not collected for the top-level model.
To enable this parameter, select:
Specify referenced model for Scope of coverage analysis.
Parameter:
CovIncludeTopModel |
Type: Character vector or string |
Value:
'on' |'off' |
Default:
'on' |