3

I'm using system verilog coverage and i want to check bins range. I want it to be within the range 1000-2000 But only he values that are in mod 5 will be sampled. For example 1000, 1005, 1010 etc.

Thanks for the help!

adir
  • 1,257
  • 2
  • 16
  • 22

1 Answers1

4

As far as I know, this is easily possible in SV 2012. Here's how it would look in your case:

coverpoint x {
  bins mod5[] = {[1000:2000]} with (item % 5 == 0);
}

You can read more in section 19.5.1.1 of the IEEE Std 1800-2012. If you don't have an older simulator that can just do SV 2009, then you have to define the values by hand.

Greg
  • 18,111
  • 5
  • 46
  • 68
Tudor Timi
  • 7,453
  • 1
  • 24
  • 53