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