Stateflow User's Guide Previous page   Next Page

Model Coverage for Truth Tables

Stateflow reports model coverages for the decisions made by the objects in a Stateflow diagram during model simulation. The model coverage report includes coverage for the decisions made by a truth table function. This section examines model coverage for an example truth table, check_temp, which is tested during simulation in the following Stateflow diagram:

The following shows the contents of the check_temp truth table:

You generate model coverage reports for a model during simulation. You first specify the creation of the reports in Simulink and then simulate the model. When simulation ends, a model coverage report appears in a browser window. See Making Model Coverage Reports for information on how to set up a model coverage report.

The following is the part of a model coverage report that reports on the check_temp truth table:

Coverage for the truth table function in the Coverage (this object) column shows no valid coverage values. The reason for this is that the container object for the truth table function, the chart, makes no decision on whether to execute the check_temp truth table or not.

Stateflow implements a truth table by generating a graphical function for it. The decision logic of the truth table is implemented internally in the transitions of the graphical function generated for the truth table See How Stateflow Realizes Truth Tables for a description of the generated graphical function for a truth table.

The transitions of the generated graphical function for a truth table contain the decisions and conditions of the truth table. Coverage for the descendants in the Coverage (inc. descendants) column includes coverage for these conditions and decisions, which are tested when the truth table function is called.

In the case of the check_temp truth table, the only decision covered in the model coverage report is the D1 decision. There is no model coverage for the default decision, D2.

Coverages for the D1 decision and its individual conditions in the check_temp truth table function are as follows:


Previous page  Defining an Underspecified Truth Table How Stateflow Realizes Truth Tables Next page

© 1994-2005 The MathWorks, Inc.