Simulink Verification and Validation

Basic Operation of the Model Coverage Tool

This example shows how to use the dialog box for coverage settings to enable coverage for a Simulink® model and adjust the type of information that is reported.

Open the Model

The sldemo_clutch model that ships with Simulink provides a good introduction to model coverage. This model contains several blocks that have intrinsic decisions, places where control flow can take more than one path.

Open the sldemo_clutch modelOpen the sldemo_clutch model

Open the Coverage Dialog

Coverage settings are contained in a tabbed dialog that is opened by selecting "Coverage Settings..." from the Simulink Tools menu.

Open the Coverage Settings DialogOpen the Coverage Settings Dialog

Enable All Coverage Metrics

Coverage is enabled with the top checkbox on the dialog titled "Enable Coverage Reporting". Once this is enabled the other elements of the dialog become active.

Enable the coverageEnable the coverage

The instrumentation path is the portion of the model where coverage is recorded. This field should either contain the path to a subsystem (relative to the model root), or a forward slash, /, to indicate coverage will be recorded for the whole model.

The Coverage Metrics group of checkboxes control the type of coverage information that is collected during simulation. Selecting all of the checkboxes produces the most coverage information.

Select all coverage metricsSelect all coverage metrics

The coverage settings must be applied before they take effect during a simulation.

Apply settings and close the dialogApply settings and close the dialog

Run a Simulation and Produce a Coverage Report

Once coverage is enabled for a model the information is automatically recorded whenever a simulation is performed. At the end of a simulation the information is compiled into an HTML report and displayed within the built-in MATLAB® web browser.

Run the simulationRun the simulation

Close the Model

Close the sldemo_clutch modelClose the sldemo_clutch model