Specify Coverage Options - MATLAB & Simulink (original) (raw)

Before starting a coverage analysis, you specify several coverage analysis options. On the Apps tab, select Coverage Analyzer. On theCoverage tab, select Settings.

Coverage Pane

On the Coverage pane in the Configuration Parameters dialog box, set the options for the coverage calculated during simulation.

Image of the Configuration Parameters Dialog Box shows the default view of coverage options.

Enable coverage analysis

Gather specified coverage results during simulation and report the coverage. When you select Enable coverage analysis, these sections become available:

Scope of analysis

Specifies the systems for which the software gathers and reports coverage data. The options are:

You must select Enable coverage analysis to specify the scope of analysis.

Entire System

By default, generates coverage data for the entire system. The coverage results include the top-level and all supported subsystems and model references.

Referenced Models

Collect coverage for the referenced models and Observer models that you select. By default this setting collects coverage for all referenced models where the simulation mode of the Model block is Normal,Software-in-the-loop (SIL), orProcessor-in-the-loop (PIL), and for active Observer models where the simulation mode isNormal.

To specify the referenced models and Observer models for which Simulink® Coverage™ collects coverage data:

  1. Select Enable coverage analysis.
  2. For the scope of analysis, select Referenced Models.
  3. Click Select Models.
    Select Models for Coverage Analysis window shows the model sldemo_mdlref_basic that contains three model references. mObsRefMdl (Observer) and sldemo_mdlref_counter are selected to receive coverage. sldemo_mdlref_counter (Accel) cannot be selected because Accelerated models cannot be analyzed for coverage.
  4. In the Select Models for Coverage Analysis dialog box, select the referenced models or Observer models for which you want to collect coverage. You can also select the top-level model.
    The icon next to the model name indicates the simulation mode for that referenced model.
    If you have multiple Model blocks that reference the same model and whose simulation modes are the same, selecting the check box for that model selects the check boxes for all instances of that model with the same simulation mode.
  5. Click OK.

Subsystem

Coverage analysis collects coverage during simulation for the subsystem that you select. By default, generates coverage data for the entire model. To restrict coverage reporting to a particular subsystem:

  1. In the Configuration Parameters dialog box, on theCoverage pane, select Enable coverage analysis.
  2. Click Select Subsystem.
    Subsystem Selection Dialog Box shows sf_car and all of its contents for coverage analysis selection.
  3. In the Subsystem Selection dialog box, select the subsystem for which you want to enable coverage reporting and clickOK.

Include in analysis

The Include in analysis section contains two options:

Coverage metrics

Select the structural coverage level and other types of test case coverage analysis that you want the tool to perform (see Types of Model Coverage). Simulink Coverage gathers and reports those types of coverage for the subsystems, models, and referenced models that you specify.

The structural coverage levels are listed in order of strictness of test case coverage analysis:

Coverage metrics also includes Other metrics:

You must select Enable coverage analysis to select the coverage metrics.

Results

In the Results section of the Coverage Configuration Parameters, select the destination for coverage results. You must selectEnable coverage analysis on theCoverage pane to set the Results options.

See Also

Topics