Tips and Limitations
Model Build and SIL/PIL Blocks Not Supported
Code coverage does not support:
The model build process, for example, the
SIL or PIL blocks.
Code coverage settings are ignored by the
command and SIL or PIL blocks.
BullseyeCoverage License Wait
When you build your model, you might have to wait for a BullseyeCoverage license. If you want to see information about the wait, before you build your model, in the Configuration Parameters dialog box, select Verbose build.
Current Working Folder Cannot be UNC Path
If your MATLAB® current working folder is a Universal Naming Convention (UNC) path, code coverage fails.
matlabroot and File Path
matlabroot or the path to your generated
files contains a space or the
. (period) character,
code coverage might fail.
Header Files with Identical Names
Consider a model that is configured for LDRA code coverage. During the build process, if the software detects two header files with the same name in the folder for generated code, the software generates an error.
Code Coverage for Source Files in Shared Utility Folders
The software supports code coverage for source files generated in shared utility folders. If you configure code coverage for a model that uses shared utility code generation, when you build the model, you also build all source files in the shared utilities folder with code coverage enabled.
Whenever you build a model, the code coverage settings of the model must be consistent with source files that you previously built in the shared utilities folder. Otherwise, the software reports that code in the shared utilities folder is inconsistent with the current model configuration and must be rebuilt. For example, if you run a SIL simulation for a model with code coverage enabled and then run a SIL simulation for another model with code coverage disabled, the software must rebuild all source files in the shared utilities folder.
BullseyeCoverage Behavior with Inline Macros
The BullseyeCoverage tool, by default, does not provide code coverage data for inline macros.
For example, if a model generates a file
contains the macro
#define rt_SATURATE(sig,ll,ul) (((sig) >= (ul))
? (ul) : (((sig) <= (ll)) ? (ll) : (sig)) )
and the macro is in
sat_ert_rtw/sat.c, then the coverage report provides a
sat.c, but no
coverage data for the conditions within the macro
To configure the BullseyeCoverage tool to provide code coverage data for inline macros:
Open the BullseyeCoverage Browser.
Select Tools > Options to open the Options dialog box.
On the Build tab, select the Instrument macro expansions check box.
Rerun your simulation.
Alternatively, you can add the text
-macro to the
BullseyeCoverage configuration file. For more information, go
SIL and PIL Simulations with Open LDRA GUI
If you enable LDRA code coverage, you must verify that the LDRA tool suite GUI is not open when you run your SIL or PIL simulation. If the set name in the GUI differs from the set name used by the SIL or PIL simulation, the SIL or PIL simulation fails.
Minor SIL and PIL Differences for LDRA Tool Suite
The target connectivity API supports LDRA code coverage for top-model and Model block PIL.
There are minor differences in the code coverage information collected during SIL and PIL simulations. In particular, with PIL, the software does not explicitly show function exit point coverage. However, you can infer the coverage of function exit points by examining statement coverage.
PIL Zero Coverage LDRA Annotations
For a PIL simulation with LDRA code coverage specified, recorded coverage for some source files might be zero. In this case, the software provides summary information indicating that:
There is coverage to measure.
The coverage is zero.
You do not see information for individual probes on each line. The displayed summary information has an associated annotation tooltip:
0 out of N coverage probes were exercised (detailed breakdown unavailable)
PIL Support for BullseyeCoverage
Code coverage with BullseyeCoverage is available for top-model
and Model block PIL provided your PIL application can write directly
to the host file system. Your target for the PIL application must
to the host file system.
If code coverage is not available when you run the PIL application on your target hardware, you might be able to collect code coverage measurements by running the PIL application on an instruction set simulator that supports direct file I/O with the host file system.
Modify Legacy Code
If you modify legacy code and rerun a SIL or PIL simulation, the legacy code is recompiled. However, the code from the model may be up-to-date. In this case, the code generation report is not updated and does not show the modified legacy code. Instead, the code coverage information for the modified legacy code is displayed with reference to the original legacy code. You must regenerate the report. For more information, see Limitation.