Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Verification and Validation   

getCoverageInfo - Coverage information for Simulink Design Verifier blocks

Syntax

[coverage, description] = getCoverageInfo(cvdo, object)
[coverage, description] = getCoverageInfo(cvdo, object, metric)
[coverage, description] = getCoverageInfo(cvdo, object, metric, ignore_descendants)

Description

[coverage, description] = getCoverageInfo(cvdo, object) collects Simulink Design Verifier coverage for object, based on coverage results in cvdo. object can be a handle to any 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 any 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.

Inputs

cvdo

cvdata object

object

In the model or Stateflow chart, object that received Simulink Design Verifier coverage. The following are valid values for object.

BlockPath

Full path to a model or block

BlockHandle

Handle to a model or block

slObj

Handle to a Simulink API object

sfID

Stateflow ID from a singly instantiated Stateflow chart

sfObj

Handle to a Stateflow API object from a singly instantiated Stateflow chart

{BlockPath, sfID}

Cell array with the path to a Stateflow chart and the ID of an object in that chart

{BlockPath, sfObj}

Cell array with the path to a Stateflow chart and a handle to a Stateflow object in that chart

[BlockHandle, sfID]

Array with a Stateflow chart handle and the ID of an object in that chart

metric

cvmetric.Sldv enumeration object with values that correspond to Simulink Design Verifier library blocks.

test

Test Objective block

proof

Proof Objective block

condition

Test Condition block

assumption

Proof Assumption block

ignore_descendants

Boolean value that specifies to ignore the coverage of descendant objects if set to 1.

Outputs

coverage

Two-element vector of the form [covered_outcomes total_outcomes].

covered_outcomesNumber of test objectives satisfied for object
total_outcomesTotal number of test objectives for object

coverage is empty if cvdo does not contain decision coverage results for object.

description

Structure array containing descriptions of each test objective, and descriptions and execution counts for each outcome within object.

Examples

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)

Alternatives

To collect and display coverage results for Simulink Design Verifier library blocks using the Coverage Settings dialog box:

  1. Open the model.

  2. In the Model Editor, select Tools > Coverage Settings.

  3. On the Coverage tab, under Coverage Metrics, select Simulink Design Verifier.

  4. Click OK.

  5. Simulate the model and review the results.

See Also

conditioninfo | cvsim | decisioninfo | mcdcinfo | sigrangeinfo | tableinfo

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS