Reputation: 65
I am trying to define coverage using systemverilog for a large coverage area. For example, I would like to define a coverage bin that starts at 24'h000000
, ends at 24'h001ff0
, and increments by 24'h000008
. I have tried this so far; however, it does not compile.
bins scratchpad = {24'h000000:24'h000008:24'h001ff0};
This gives a syntax error: syntax error: token is ':'
.
Is there a way to avoid having to explicitly write out all the coverage points? I know that I can define a bin with {24'h000000:24'h001ff0}
, but this contains points that I do not wish to include.
Upvotes: 0
Views: 2223
Reputation: 42698
You can add a with
clause
bins scratchpad[] = {[24'h000000:24'h001ff0]} with (item % 8 == 0);
See http://go.mentor.com/ready-for-systemverilog-2012 for other options and the IEEE 1800-2012 LRM section 19.5.1.1
Upvotes: 3