Coverpoint bins inclusion / exclusion

Given the following coverpoint, I have 5 bins defined. I would also like to create a covered (not “default”) bin for all values besides the ones already listed in the previous 5 bins.

cp_DstIp : coverpoint arp_txn.dIP {
bins dut_IP = {DUT_IP};
bins routableIp={routeIp[0], routeIp[1], routeIp[2], routeIp[3]};
bins OtherIp = ???
}

In reply to bmorris:

You can do

bins OtherIp ={[0:MAXVALUE]} with (!(item inside {DUT_IP, routeIp[0], routeIp[1], routeIp[2], routeIp[3]}));

Note that if routelp is an array of 4 values, you can do

cp_DstIp : coverpoint arp_txn.dIP {
bins dut_IP = {DUT_IP};
bins routableIp[]= routeIp;
bins OtherIp = {[0:MAXVALUE]} with (!(item inside {DUT_IP, routeIp}));
}

In reply to dave_59:

I guess Brian wanted to know if it’s possible to specify this without having to repeat himself, i.e. not having to re-specify the sets for the other bins.

Aside from default there isn’t any construct that can be used to collect all other bin values, but using it won’t make it mandatory to cover those bins. You’ll have to do it like Dave showed you, but the bright side is that any changes you need to make (like adding a new bin, etc.) are centralized there and you’ll instantly see that you need to update your OtherIp bin as well.

In reply to Tudor Timi:

Both of you have read my mind, all of the above is valuable information. I didn’t find what I needed in the “covergroup” section of Chris Spear’s book; I completely forgot about the array locator methods. Good stuff.

In reply to bmorris:

Neither of these techniques seem to work with my simulator (RivieraPro); shoot.

bins routableIp= routeIp;
bins OtherIp = {[0:MAXVALUE]} with (!(item inside {DUT_IP, routeIp}));

Thanks anyway!

In reply to bmorris:

I implore anyone to get this example working (preferably with RP). I am trying to understand how to do bin exclusion use array locator methods, etc, as described above. Perhaps only Questa can do this currently.

In reply to bmorris:

You will need to take up tool specific issues with your vendor.

In reply to dave_59:

Do you know to make a single bin, when a coverpoint is any of the values in that array?

bit [31:0] my_array[4]={1,2,3,4};

//…

bins single_bin = my_array; // syntax?

In reply to bmorris:
That is the correct syntax.