How to create two bins - one for interesting value, one for the others?

Hi,

I have a question on how to create two bins - one for interesting value, the other for the rest possible values?

Supposing 2bit pkt_len has value set {0,1,2,3}, I want to create two bins - one bin = 1, one bin = {0,2,3}.
Manually to analyze and create is not a problem. Is there a smart way(more general solution) for any other cases - such as 3bit, 4bit variables?
I tried default bins, but it is not counted into the coverage score. In this case, I also want to see both two bins are counted for the functional coverage score/grade.

module tb;
bit[1:0] pkt_len = $urandom_range(3);

covergroup cmdline_parameter;
	pkt_len_cvpt : coverpoint pkt_len {
	   bins default_val = {1};
	   bins other_val = default;
	} 
endgroup

cmdline_parameter cmdline_param = new();

initial begin
  cmdline_param = new();
  #1;
  cmdline_param.sample();
  $display("pkt_len=%0d",pkt_len);
  $finish();
end

endmodule

In reply to mlsxdx:

covergroup cg;
cpa1 : coverpoint a {
option.auto_bin_max = 16;
bins a1 = {1,2,3};
}
cpa2 : coverpoint a {
option.auto_bin_max = 16;
ignore_bins a1 = {1,2,3};
}

coverpoint b;
cross a,b;

endgroup

One way is to use the “auto_bin_max” option to specify the number of bins required based on the bit width and as coded in “cpa2” using the ignore_bins. The “cpa2” coverpoint covers all points except {1,2,3}.

You can use this for generic

module tb;
bit[1:0] pkt_len = $urandom_range(3);

covergroup cmdline_parameter;
pkt_len_cvpt : coverpoint pkt_len {
bins default_val = {1};
bins other_val = {[0:$]} with (!(item inside {1}));
}
endgroup

cmdline_parameter cmdline_param = new();

initial begin
cmdline_param = new();
#1;
cmdline_param.sample();
$display(“pkt_len=%0d”,pkt_len);
$finish();
end

endmodule