Collect Saturation on Integer Overflow Coverage
This example shows how to configure your model to collect saturate on integer overflow coverage.
slvnvdemo_saturation_on_overflow_coverage model contains three Sum blocks configured to saturate on integer overflow. This model uses a test harness that supplies the
Test Unit subsystem with a set of inputs that results in full saturation on integer overflow coverage on one Sum block and incomplete coverage on the other two.
Enable Saturation on Integer Overflow Coverage on the Model
On the Modeling tab, click Model Settings. In the Configuration Parameters window, in the left pane, click Coverage. To enable saturation on integer overflow coverage, under Coverage metrics, click Other metrics to expand the list. Select the Saturation on integer overflow metric. This model is already configured to collect saturation on integer overflow coverage.
Enable Saturate on Integer Overflow on a Block
For a block to receive saturation on integer overflow coverage, you must configure the block to saturate on integer overflow. If you do not select the block parameter, then saturation on integer overflow coverage analysis does not report on the block.
For example, in the example model, double-click the
Test Unit subsystem, then double-click the Controller subsystem. Double-click on one of the Sum blocks to open its Block Parameters window. Note that, in the Signal Attributes tab, the Saturate on integer overflow block parameter is selected.
Simulate the Model and Examine the Coverage Results
In the model, click the Run (Coverage) button. After the simulation completes, the Coverage Details pane opens, and displays the coverage report.
Click the green Sum block. From the report, you can see that the saturation objective is true for two time steps and false for one time step. The true outcome indicates that the block reached its integer overflow threshold and saturated.
Click one of the red Sum blocks. The block does not ever reach the integer overflow threshold, and thus never saturates, because the saturation outcome is false for all 3 time steps. This results in a reported saturation on integer overflow coverage of 50%.