Question about ignoring some crosses

Hi,

I’m trying to ignore some bins of a cross.

bit [1:0] a;
bit [1:0] b;

cp_a : coverpoint a;
cp_b : coverpoint b;

cp_cross : cross a, b;

This results in all the following crosses

a[0]. b[0], a[1].b[0], a[2].b[0], a[3].b[0],
a[0]. b[1], a[1].b[1], a[2].b[1], a[3].b[1],
a[0]. b[2], a[1].b[2], a[2].b[2], a[3].b[2],
a[0]. b[3], a[1].b[3], a[2].b[3], a[3].b[3]; // total = 16 bins

out of these crosses, I want to ignore some crosses, like when b = 1, a=1,2,3 and when b=2 a=2,3. These specific crosses are to be ignored. (the resultant bins would be something like)

a[0]. b[0], a[1].b[0], a[2].b[0], a[3].b[0],
a[0]. b[1],
a[0]. b[2], a[1].b[2],
a[0]. b[3], a[1].b[3], a[2].b[3], a[3].b[3]; // total = 11 bins

This is just a representation of my problem and in actual case the total automatically generated bins and the bins to be ignored are very high so cant do them manually.
How can I do this? I tried using intersect but missing some concept of its functioning to get it right.

Thanks

In reply to szy0014:

Great… I was experimenting with binsof and intersect and got what I wanted.

For anyone else who want to know how I did this

cp_cross : cross a, b{
ignore_bins ignore1 = binsof(b) intersect (1) && binsof(a) intersect(1,2,3)
ignore_bins ignore2 = binsof(b) intersect (2) && binsof(a) intersect(2,3)
}

Please suggest if there is any better way to do this.

Thanks

cp_cross : cross a, b
   { ignore_bins ign = cp_cross with (a==b); }

This is new in 1800-2012

In reply to dave_59:

Oh. nice. But, whats (a==b) where are we specifying the actual bins which we want to ignore?

In reply to szy0014:

19.6.1.2 Cross bin with covergroup expressions
The with clause in a select_expression specifies that only those bin tuples in the subordinate
select_expression for which sufficiently many value tuples satisfy the given with_covergroup_expression
(i.e., for which the expression evaluates to true, as described in 12.4) are selected.

In this example the select_expression is cp_cross, all the bins of cp_cross, and the with_covergroup_expression is a==b. So it is selecting only the bins whose value tuples will make the expression true are per of the bin set. Think of the with clause as a constraint on set of value tuples, and the entire solution space meeting those constraints becomes the set of bins selected.

In reply to dave_59:

Oh great. Thanks