main content

basic operation of the model coverage tool -凯发k8网页登录

this example shows how to use the configuration parameters dialog to enable coverage for a simulink® model and adjust the type of information that is reported.

open example model

the sldemo_clutch example 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 coverage settings dialog

you can find coverage settings under the coverage pane of the configuration parameters dialog box. to navigate to this pane, from the modeling tab, click model settings.

enable multiple coverage metrics

to enable coverage, select enable coverage analysis. this setting enables the other options in the coverage pane.

the coverage metrics section controls the types of coverage information to collect during simulation.

the structural coverage level drop-down menu allows you to select which structural coverage metrics to analyze during the simulation. these are ordered from the least rigorous (block execution) to the most rigorous (modified condition decision (mcdc)).

for this example, select the modified condition decision (mcdc) structural coverage level. the resulting report also includes decision and condition coverage results.

you can find additional coverage metrics under the other metrics toggle panel. click the black arrow to expand this panel and see the available metrics. selecting all coverage metrics provides the most coverage information.

for this example, select signal range and lookup table.

click ok to apply your selected settings and close the coverage settings dialog box.

run simulation and explore results

once you enable coverage analysis for your model, simulate the model to collect coverage information. at the end of the simulation, the model coverage details pane opens, showing results for the model. additionally, the model displays a coverage highlighting overlay that visually indicates coverage completeness for each object in the model.

click the run (coverage) button to simulate the model and collect coverage.

produce coverage report from results explorer

after the simulation completes, in the coverage tab of the toolstrip, click results explorer. the coverage results explorer offers various functionality for processing, displaying, and reporting coverage results for your model.

click the generate report link at the bottom of the coverage results explorer window. this produces an html report of coverage information that displays within the built-in matlab® web browser.

网站地图