User`s guide
18 Coverage Collection During Simulation
18-22
For an example of coverage data for Simulink Design Verifier functions in a coverage
report, see “Simulink Design Verifier Coverage” on page 19-45.
Relational Boundary Coverage
If the MATLAB function block contains a relational operation, the relational boundary
coverage metric applies to this block.
If the MATLAB function block calls functions containing relational operations multiple
times, the relational boundary coverage reports a cumulative result over all instances
where the function is called. If a relational operation in the function uses operands of
different types in the different calls, relational boundary coverage uses tolerance rules
for the stricter operand type. For instance, if a relational operation uses int32 operands
in one call, and double operands in another call, relational boundary coverage uses
tolerance rules for double operands.
For information on the tolerance rules and the order of strictness of types, see “Relational
Boundary Coverage”.
How to Collect Coverage for MATLAB Functions
When you simulate your model, the Simulink Verification and Validation software can
collect coverage data for MATLAB functions configured for code generation. To enable
model coverage, select Analysis > Coverage > Settings and select Coverage for this
model.
You collect model coverage for MATLAB functions as follows:
• Functions in a MATLAB Function block
• Functions in an external MATLAB file
To collect coverage for an external MATLAB file, on the Coverage tab of the
Coverage Settings dialog box, select Coverage for MATLAB files.
• Simulink Design Verifier functions:
• sldv.condition
• sldv.test
• sldv.assume
• sldv.prove