Jean
Jean

Reputation: 22735

Coverage permutation

Is it possible to create coverpoints using various permutations of local variables ? Something like below

covergroup test1 with function sample(int i) ;  
  type_option.comment = "Config";
  int array1 [] = {0,1};
  int array2 [] = {3,4,9};
  int array3 [] = {5,6};
  coverpoint i
  {
    bins bin1 [] = {array1,array2};
    bins bin2 [] = {array2,array3};
  }
endgroup

Upvotes: 0

Views: 330

Answers (1)

dave_59
dave_59

Reputation: 42738

You can't declare local variables inside a covergroup, and you can't have array operations in a bin set. The closest you can do is

int array1 [] = {0,1};
int array2 [] = {3,4,9};
int array3 [] = {5,6};
int binset1[];
int binset2[];
covergroup test1 with function sample(int i) ;  
  type_option.comment = "Config";

  coverpoint i
  {
    bins bin1 [] = binset1;
    bins bin2 [] = binset2;
  }
endgroup
...
binset1 = {array1,array2};
binset2 = {array3,array4};
test1 = new();

Upvotes: 2

Related Questions