Retrieve coverage information for Simulink
Design Verifier blocks
from cvdata
object
[coverage, description]
= getCoverageInfo(cvdo, object)
[coverage, description]
= getCoverageInfo(cvdo, object, metric)
[coverage, description]
= getCoverageInfo(cvdo, object, metric, ignore_descendants)
[
collects Simulink®
Design Verifier™ coverage
for coverage
, description
]
= getCoverageInfo(cvdo
, object
)object
, based on coverage results in cvdo
. object
is
a handle to a block, subsystem, or Stateflow® chart. getCoverageData
returns
coverage data only for Simulink
Design Verifier library blocks
in object
's hierarchy.
[
returns
coverage data for the block type specified in coverage
, description
]
= getCoverageInfo(cvdo
, object
, metric
)metric
.
If object
does not match the block type, getCoverageInfo
does
not return data.
[
returns
coverage data about coverage
, description
]
= getCoverageInfo(cvdo
, object
, metric
, ignore_descendants
)object
, omitting coverage
data for its descendant objects if ignore_descendants
equals 1
.
|
| ||||||||||||||||
|
In the model or Stateflow chart, object that received Simulink
Design Verifier coverage.
The following are valid values for
| ||||||||||||||||
|
| ||||||||||||||||
|
Boolean value that specifies to ignore the coverage of descendant
objects if set to |
|
Two-element vector of the form
Note If |
|
Structure array containing descriptions of each objective, and descriptions and execution
counts for each outcome within Note If |
Get coverage for all
Proof Objective blocks in Verification
Subsystem1
mdl = 'sldvdemo_powerwindow_vs'; open_system(mdl) set_param(mdl, 'StopTime', '10') testObj = cvtest(mdl); testObj.settings.designverifier = 1; data = cvsim(testObj); verifSubsys = [mdl '/Verification Subsystem1']; covProof = getCoverageInfo(data, verifSubsys, cvmetric.Sldv.proof)
covProof
is a two-element vector of the form
[covered_outcomestotal_outcomes]
showing 1 covered outcome
out of 1 total proof objective outcome.
Get coverage for a specific Test Objective block in
Verification Subsystem1
mdl = 'sldvdemo_powerwindow_vs'; open_system(mdl) set_param(mdl, 'StopTime', '10') testObj = cvtest(mdl); testObj.settings.designverifier = 1; data = cvsim(testObj); verifSubsys = [mdl '/Verification Subsystem1']; testObjBlock = [verifSubsys '/Test Objective2']; covTest = getCoverageInfo(data, testObjBlock)
covTest
is a two-element vector of the form
[covered_outcomes total_outcomes]
showing 0 covered outcomes
out of 1 total test objective outcome.
Get coverage data and descriptions for all available
metrics recorded in Verification Subsystem1
mdl = 'sldvdemo_powerwindow_vs'; open_system(mdl) set_param(mdl, 'StopTime', '10') testObj = cvtest(mdl); testObj.settings.designverifier = 1; data = cvsim(testObj); verifSubsys = [mdl '/Verification Subsystem1']; [covAll, descrAll] = getCoverageInfo(data, verifSubsys, ... {cvmetric.Sldv.proof, cvmetric.Sldv.test})
covAll
is a cell array with cells corresponding to the
objective outcomes for each metric. descrAll
is a cell array with
cells corresponding to descriptions of each metric.
covAll{1} covAll{2}
covAll{1}
is a two-element vector of the form [covered_outcomes
total_outcomes] showing 1 covered outcomes out of 1 total proof objective outcomes.
covAll{2}
is a two-element vector of the form
[covered_outcomes total_outcomes] showing 0 covered outcomes out of 1 total test
objective outcomes.
descrAll{1} descrAll{2}
descrAll{1}
is a structure array containing descriptions of
each proof objective, and descriptions and execution counts for each outcome.
descrAll{2}
is a structure array containing descriptions of
each test objective, and descriptions and execution counts for each outcome.
Use the coverage settings to collect and display coverage results for Simulink Design Verifier library blocks:
Open the model.
In the Model Editor, select Model Settings on the Modeling tab.
On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
Under Coverage metrics, select Objectives and constraints.
Click OK to close the Configuration Parameters dialog box and save your changes.
Simulate the model and review the results.
complexityinfo
| conditioninfo
| cvsim
| decisioninfo
| mcdcinfo
| overflowsaturationinfo
| sigrangeinfo
| sigsizeinfo
| tableinfo