Retrieve coverage information for Simulink Design Verifier blocks from cvdata object
= getCoverageInfo(cvdo, object)
[coverage, description] = getCoverageInfo(cvdo, object, metric)
[coverage, description] = getCoverageInfo(cvdo, object, metric, ignore_descendants)
[coverage, description] = getCoverageInfo(cvdo, object) collects Simulink® Design Verifier™ coverage for 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.
[coverage, description] = getCoverageInfo(cvdo, object, metric) returns coverage data for the block type specified in metric. If object does not match the block type, getCoverageInfo does not return data.
[coverage, description] = getCoverageInfo(cvdo, object, metric, ignore_descendants) returns coverage data about 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 object.
cvmetric.Sldv enumeration object with values that correspond to Simulink Design Verifier library blocks.
Boolean value that specifies to ignore the coverage of descendant objects if set to 1.
Two-element vector of the form [covered_outcomes total_outcomes].
coverage is empty if cvdo does not contain decision coverage results for object.
Structure array containing descriptions of each test objective, and descriptions and execution counts for each outcome within object.
Collect and display coverage data for the Test Objective block named True in the sldvdemo_debounce_testobjblks model:
mdl = 'sldvdemo_debounce_testobjblks'; open_system(mdl) testObj = cvtest(mdl) testObj.settings.designverifier = 1; data = cvsim(testObj) blk_handle = get_param([mdl, '/True'], 'Handle'); getCoverageInfo(data, blk_handle)
Use the Coverage Settings dialog box to collect and display coverage results for Simulink Design Verifier library blocks:
Open the model.
In the Model Editor, select Analysis > Coverage > Settings.
On the Coverage tab, select Coverage for this model.
Under Coverage metrics, select Simulink Design Verifier.
Click OK to close the Coverage Settings dialog box and save your changes.
Simulate the model and review the results.