Vivado supports the code coverage exclusion feature for exclusion and inclusion of signals, instances, modules, directories, and files. The support is available for both xelab and xcrg, the generated report shows the exclusions and enhances the coverage score. The support can be used for both Verilog/System Verilog and VHDL languages.
The exclusion file must be created and passed through xelab/xcrg command as
-ccExclusionFile <file_name>. The exclusion file support
keywords and signs listed below.
- module
- file
- instance
- signal
- dir
- + (to include specific module/instance/hierarchy)
- - (to exclude specific module/instance/hierarchy)
- * (wildcard support)
The supported inclusion types are as follows:
- Instance level exclusion:
- Hierarchical paths are allowed for instance level. Can be just instance name as. For such cases, all instances of that name in different hierarchies are also excluded (-) or included (+).
- Wildcard on instance excludes (-) or includes (+) all instances of mentioned string.
- Module level exclusion:
- Cannot have hierarchical level exclusion (-) or inclusion (+).
- Wildcard on module excludes (-) or includes (+) all modules of mentioned string.
- File level exclusion:
- Can be either relative or absolute path.
- Wildcard after filepath<path/to/directory/*> excludes (-) or includes (+) all files in that directory.
- Exclusion (-) or inclusion (+) passed to 'dir' keyword excludes/includes all files recursively in that particular directory.
- Signal level exclusion:
- Only toggle code coverage exclusion (-) or inclusion (+) are allowed.
- Can be simple signal names or hierarchical signal names.
- Wildcards can be applied to both simple and hierarchical signals. If specified after an instance, all signals of that particular instance are excluded/included. If specified after module ( :: ), the mentioned signals are excluded/included in all instances of particular module.
Exclusion (-) Vs Inclusion (+) Definition:
- Exclusion (-)
- Mentioned string is excluded in file/module/instance/signal level in the code coverage report as per keyword specified.
- Inclusion (+)
- Only mentioned string is included in file/module/instance/signal level in the code coverage report as per keyword specified. The rest is excluded.
For the current example design, you must create a file and add the exclusion and inclusion of signals/instances/modules/directories/files in the project folder.
../axi_vip_0_ex/axi_vip_0_ex.sim/sim_adv_mst_active__pt_passive__slv_comb/behav/xsim/
A sample exclusion file declaration.