Hi,
I have a case like this:
covergroup abc;
max_quad_vec : coverpoint int_max; //only 0 to 3
min_quad_vec : coverpoint int_min; //only 0 to 3
cross_quad : cross max_quad_vec, min_quad_vec {
bins same_quad = cross_quad with (max_quad_vec == min_quad_vec); // it should be 4 bins
bins diff_quad = cross_quad with (max_quad_vec != min_quad_vec); // it should be 12 bins
}
endgroup
:
And failed in compilation saying that the should not be used in the code above.
Do you have better approach instead of listing them out by using binsof and intersect?
Thank you – Hoong Han.
In reply to Hoong Han:
It seems like you want all 16 bins for your cross, so there is no need for any bin specification. When specifying a cross, you automatically 16 individual bins, and the only thing you can do with a cross-bin specification is ignore or merge individual bins.
If you are trying to separate the cross bins for debugging or tracking purposes, then the best thing to do is specify two different crosses, and ignore the bins you don’t need
same_cross_quad : cross max_quad_vec, min_quad_vec {
ignore_bins diff_quad = same_cross_quad with (max_quad_vec != min_quad_vec);
}
diff_cross_quad : cross max_quad_vec, min_quad_vec {
ignore_bins same_quad = diff_cross_quad with (max_quad_vec == min_quad_vec);
}
Did not check the syntax, but I hope this gets you going in the right direction.
In reply to dave_59:
Hi Dave,
Yap, you show me the solution that I missed out! Thanks Dave!