1

1.Is it possible to explicitly list cross coverpoints in system verilog ? Something like below..

2.Since I am only interested in the occurrences of doublets {{1,2},{3,1},{2,4}} and not b1or b2 standalone, can I accomplish this without creating coverpoints b1 and b2 (i.e just write cross coverage)?

covergroup test1 with function sample(int i,int j) ;  
  type_option.comment = "Config";
  b1:coverpoint int {bins m1[]={1,2,3};}
  b2:coverpoint int {bins m2[]={1,2,4};}
  mx :cross     int,int
                   {
                     bins mx1[] ={{1,2},{3,1},{2,4}};
                   }
endgroup
Jean
  • 21,665
  • 24
  • 69
  • 119

1 Answers1

1

You probably do not want a cross for what you are trying to cover. Bins for a cross are for merging or excluding tuples, not creating them. You probably want to use a simple coverpoint

cp: coverpoint {i,j} {
   bins mx[]= { {32'd1,32'd2},{32'd3,32'd1},{32'd2,32'd4} };
}

or more simply

cp: coverpoint {i[3:0],j[3:0]} {
  bins mx[]= { 'h12,'h31,'h24 };
}
dave_59
  • 39,096
  • 3
  • 24
  • 63
  • 1
    It's going to look kind of awkward in the report, though. I'd still go for cross coverage and set the weights on the single coverpoints to 0. – Tudor Timi Aug 15 '15 at 07:16
  • @Tudor, it really depends on what the OP was looking to cover. – dave_59 Aug 16 '15 at 05:05
  • @dave_59 isn't this approach just concatenating two integers ? What if if i and j are enums ? – Jean Aug 17 '15 at 14:40
  • Yes. You can concatenate two enums just as easily. – dave_59 Aug 17 '15 at 15:28
  • Thanks..But the bins end up showing on the report as `bin_00010002` when `enum1=1` and `enum2=2` were concatenated(Less readable like Tudor mentioned). Is it possible to explicitly list cross coverages (My question#1) ? – Jean Aug 17 '15 at 20:24