Types of Coverage Reports
If you simulate your model with coverage enabled using the Run button, or you generate a report from the Results Explorer, Simulink® Coverage™ creates one or more model coverage reports after a simulation.
Report Type | Description | HTML Report File Name |
---|---|---|
Top-Level Model Coverage Report | Provides coverage information for all model elements, including the model itself. |
|
Model Summary Report | Provides links to coverage results for referenced models and external MATLAB® files in the model hierarchy. Created when the top-level model includes Model blocks or calls one or more external files. |
|
Model Reference Coverage Report | Created for each referenced model in the model hierarchy; has the same format as the model coverage report. |
|
External MATLAB File Coverage Report | Provides detailed coverage information about any external MATLAB file that the model calls. There is one report for each external file called from the model. |
|
Subsystem Coverage Report | Model coverage report includes only coverage results for the subsystem, if you select one. | ; model_name is
the name of the top-level model |
Code Coverage Report | Provides coverage information for C/C++ code in S-Function blocks, or for models in SIL mode. | ,
or
|
Model Summary Report
If the top-level model contains Model blocks or calls external files, the
software creates a model summary coverage report named
.
The title of this report is Coverage by Model.model_name
_active_summary_cov.html
The summary report lists and provides links to coverage reports for Model block referenced models and external files called by MATLAB code in the model. For more information, see External MATLAB File Coverage Report.
The following graphic shows an example of a model summary report.
It contains links to the model coverage report (mExternalMfile
),
a report for the Model block (mExternalMfileRef
),
and three external files called from the model (externalmfile
,I externalmfile1
,
andexternalmfile2
).
Model Reference Coverage Report
If your top-level model references a model in a Model block,
the software creates a separate report, named
,
that includes coverage for the referenced model. This report has the
same format as the Top-Level Model Coverage Report. Coverage results are recorded as
if the referenced model was a standalone model; the report gives no
indication that the model is referenced in a Model block.reference_model_name
_cov.html
External MATLAB File Coverage Report
If your top-level model calls any external MATLAB files, select MATLAB files on the Coverage pane in the
Configuration Parameters dialog box. The software creates a report, named
, for
each distinct file called from the model. When there are several calls to a given file
from the model, the software creates only one report for that file, but it accumulates
coverage from all the calls to the file. The
external MATLAB file coverage report does not include information about what parts of the
model call the external file.MATLAB_file_name
_cov.html
The first section of the external MATLAB file coverage report contains summary information about the external file, similar to the model coverage report.
The Details section reports coverage for the external file and the function in that file.
The Details section also lists the content of the file, highlighting the code lines that have decision points or function definitions.
Coverage results for each of the highlighted code lines follow in the report. The following graphic shows a portion of these coverage results from the preceding code example.
Subsystem Coverage Report
In the Coverage pane of the Configuration Parameters dialog box, when you select Enable coverage analysis, you can click Select Subsystem to request coverage for only the selected subsystem in the model. The software creates a model coverage report for the top-level model, but includes coverage results only for the subsystem.
However, if the top-level model calls any external files and you select MATLAB files in the Coverage pane in the Configuration Parameters dialog box, the results include coverage for all external files called from:
The subsystem for which you are recording coverage
The top-level model that includes the subsystem
If the subsystem parameter Read/Write Permissions is
set to NoReadOrWrite
, the software does
not record coverage for that subsystem.
For example, in the fuelsys
model, you click Select
Subsystem, and select coverage for the feedforward_fuel_rate
subsystem.
The report is similar to the model coverage report, except that
it includes only results for the feedforward_fuel_rate
subsystem
and its contents.
Code Coverage Report
For each custom code block, such as S-Functions and C Caller blocks, the model coverage report links to a detailed code coverage report for the C/C++ code in the block. For MATLAB Function blocks which call external MATLAB files, the model coverage report links to a detailed code coverage report for each external MATLAB file. For more information on how S-Functions appear in the report, see View Coverage Results for Custom C/C++ Code in S-Function Blocks.
If you have Embedded Coder® installed, you can also generate code coverage reports from models in SIL or PIL mode. For more information on how to generate code coverage reports for models in SIL or PIL mode, see Code Coverage for Models in Software-in-the-Loop (SIL) Mode and Processor-in-the-Loop (PIL) Mode. For more information about the code coverage report, see Code Coverage Report.