Regarding how to declare bins for unpacked array variables

logic [7:0] op555[3:0][4080:1];
This is a variable which i am tracking through the interface in my monitor class.

/data_sent.op = vif.mn.op;

So I am not getting how to declare coverpoint for this variable using bins.

Durinf compilation it is giving ERROR: * Error: …/tb/otn_scoreboard.sv(51): (vlog-2146) Illegal unpacked type expression for coverpoint expression of Coverpoint ‘op555’.

I am not getting how to create coverpoints for an unpacked variable in OVM Enviroment.

Thanks and Regards,

Mahavir Rana

coverpoints must be integral expressions. You have a few options

  1. Create an array of covergroups and have each covergroup sample a different element of your unpacked array.
  2. cast your unpacked array into an integral variable and cover that. (not a likely option here).
  3. Create a function or some additional code that reduces the set of data down to a manageable integral coverpoint.

You will have to explain a little more about what you are looking to get coverage on this large amount of data.

In reply to dave_59:

Hello,
First of all thanks for your reply.

See I have an output signal which is an unpacked array type. i.e. logic [7:0]OP[3:0][4080:0];
for this output signal I am not able to declare bins.
I have tried to pack this array(using do pack function) and then declare the bins but it is not working.

I am using do pack function as
function void do_pack(uvm_packer packer);
otn_trans t1;
super.do_pack(packer);
packer.pack_field_int(t1.op, $bits(t1.op));
t1.op.do_pack(packer);
endfunction : do_pack

It was showing error

  1. Field/method name (do_pack) not in ‘op’
  2. Arg. ‘value’ of ‘pack_field_int’: Illegal assignment to type ‘reg[63:0]’ from type ‘reg[7:0] $[3:0][4080:1]’: Cannot assign an unpacked type to a packed type.
  3. Bit stream casting is only allowed on same size data.

Do you mean for each ROW and COLUMN I have to declare different cover group?
Is there any in built function which help to cast an unpacked expression to integral expression?

In reply to mahavirrana:

You are trying to convert an unpacked array of 8x4x4081=130592 bits into a single integral vector. That is probably not what you want to do.
I would help if you could explain what you are looking to cover WITHOUT USING SYNTAX.

In reply to dave_59:

Hi,
Actually my question is very simple,
I have an OUTPUT signal i.e. logic [7:0]OP[3:0][4080:0]
So is there any solution for its coverpoint to declare a BIN for it.
Because when i am trying to declare a coverpoint for it it is showing errors.

In reply to mahavirrana:

There is no solution to the question you have asked.