Reputation: 1485
In my verification environment under sys
there is an instance of timer_sve
. Under timer_sve
I have 2 other instances: timer
and ocp_master
:
extend sys {
timer_sve : timer_sve_u is instance;
};
unit timer_sve_u {
timer : timer_u is instance;
ocp_master : ocp_u is instance;
};
I need to collect coverage only for timer
.
I've tried this code (and many other variations of it) to disable the coverage of ocp_master
:
extend sys {
timer_sve : timer_sve_u is instance;
setup() is also { // The code to disable ocp_master's coverage
global.covers.set_cover_block("ocp_u", FALSE);
};
};
The code is compiled and run successfully but it continues to collect coverage for ocp_master
...
How can I disable collecting ocp_master
coverage?
Really appreciate your help.
Upvotes: 1
Views: 397
Reputation: 7573
The method set_cover_block(...)
doesn't take the unit as an input, but the module (i.e. file) in which the coverage elements were defined. Try changing it to take the file in which you extend your ocp_u
with coverage definitions.
What I also do to disable certain coverage items/groups/etc. is set the when
option to FALSE
:
extend some_struct {
cover some_cover using also
when = FALSE;
};
Some speculation on my part:
Disabling coverage using set_cover_block(...)
will probably not instrument the excluded code for coverage (i.e. completely ignore the coverage definitions) and make the simulation run faster than by disabling it using the when
option.
Upvotes: 1