I need to collect a coverage only when one of the items has a specific value (only when size == BYTE
). The code I wrote:
item size : size_t = trans.size using no_collect;
item byte_alignment : uint(bits:2) = trans.addr using no_collect;
cross size, byte_alignment using ignore = (size != BYTE);
In the test I run, size != BYTE
, but I still have the cross_size__byte_alignment
item in the coverage statistics with zero Overall Average Grade.. Why?
How to prevent collecting coverage for size != BYTE
?
Thank you for your help
use the "when" option on the item/cross to say when you want to collect coverage. use the "ignore" option to remove buckets from the item/cross.
if you want to collect only when size equals BYTE and you do not want to see the buckets where size is not BYTE, combine both options:
cross size, byte_alignment using ignore = (size != BYTE), when = (size == BYTE);