Creating array of coverpoints to take coverage of a bus

Hello,
I’m trying to get coverage for a bus.
Let’s say the bus is 8 bits wide.
For each bit in the array, I would like to see if it transitioned from 0->1 and about 1->0.
So actually I want to make a covergroup for the bus, and a coverpoint for each bit, with 2 bins for each transition.

The pseudo code for I want to do is as following:


covergroup bus_a @(time);
array_of_coverpoints : coverpoint bus[i]{
bins zto = (o=>1);
bins otz = (1=>0);
}
endgroup

This way when looking at the coverage collection in imc for example, I won’t have a lot of lines for each bit in each bus like I would have with a covergroup array (and that’s why I don’t want to do an array of covergroups).

Thank you

In reply to Ariel Elliassi:

First of all, most tools have much more efficient ways of collecting toggle coverage without having to use covergroups.

There are no arrays of coverpoints, only covergroups.

covergroup bus_a(int i) @(sample_event);
  option.per_instance = 1;
  toggle_cp : coverpoint bus[i]{
    bins zto = (0=>1);
    bins otz = (1=>0);
  }
endgroup

bus_a cg[8];

initial foreach (cg[i]) cg[i] = new(i);


In reply to dave_59:
Thank you.
We have another option of manually writing 8 coverpoints, one for each index, but that’s not really elegant.

Is there another way of collecting coverage of bus transitions?

In reply to Ariel Elliassi:

Manually writing eight coverpoints seems more elegant than most other solutions.

In reply to dave_59:

Thank you very much.