How to write cover point for arrays

Hi,
I want to know how to write cover point for logic[3:0]a[15:0]
can anyone help me.

In reply to dasaradhi:
You need to explain what functionality you are looking to cover. There are 2**64 possible values for your array.

In reply to dave_59:

Hi Dave,
Here i want matching id and matching data to cover for example
coverpoint a[0]{
bins a0={[15:0]};}

but it looks odd when we have more number of id’s like logic [3:0]a[63:0]

In reply to dasaradhi:

See Regarding Embedded Covergroup | Verification Academy

In reply to dave_59:

Thanks Dave for the link. It is very helpful. I summarize some key points here as below.

  • To implement coverage for an array, define coverage model outside class. This is because the covergroup declared in a class is an anonymous type and the covergroup name becomes the instance variable. See LRM 19.4 Using covergroup in classes: a covergroup declaration within a class is an embedded covergroup declaration. An embedded covergroup declaration declares an anonymous covergroup type and an instance variable of the anonymous type. The covergroup_identifier definesthe name of the instance variable.
  • Coverage model should be defined before it is used. It can be implemented in the same scope of class, but need to be before the class. It can be implemented in the package, then be imported for use.
  • A ref argument allows a different variable to be sampled by each instance of a covergroup.
  • option.per_instance=1 should be used.
  • A covergroup can be defined in a package,module, program, interface, checker, or class.

covergroup a_cg (ref logic[3:0] a);
  option.per_instance = 1;
  cp_a: coverpoint a;
endgroup

class my_class;

  logic [3:0] a[15:0];

  a_cg a_cg_inst[16];

  function void new();
    foreach (a_cg_inst[i])
      a_cg_inst[i] = new(a[i]);
  endfunction

endclass;