How to Pass 2D array to cover group

Hi,

I want to pass SrcToTrgt 2D array to cover group with sample function but I am getting compilation as error at line no. 3 as shown below:
covergroup abc with function sample ( ref logic [12:0] SrcToTrgt[2] ) ;

  1. C1_Cov :coverpoint SrcToTrgt
  2. {
  3. bins a1 = { SrcToTrgt[7][0], SrcToTrgt[3][1] }
  4. }
  5. endgroup

Identifier ‘SrcToTrgt’ has not been declared yet. If this error is not expected, please check if you have set `default_nettype to non.

Could you please look into this.

Thanks,
Gagan

Your tool may not be giving you the best of error messages, but there are lots of problems with your syntax. I can’t even guess what you might be thinking to do.

A coverpoint expression must return an integral value; a coverpoint may not be an unpacked array.
Bin ranges must be fixed during the construction of the covergroup. You may be confusing a covergroup constructor argument with the arguments to the overridden sample method.
It might help to explain the data you are trying to cover by show us some data values you want to sample without using any SV syntax.