I have been trying to create a basic coverage model for my FFT. I am very much new to verification and I thought a start might be to check how many of the possible data input values have been covered. The input data signal is
‘bit [63:0] s_axis_data_tdata’.
My problem is that I keep getting the error:
** Fatal: (vsim-8543) The number of singleton values exceeded the system limit of ‘2147483647’ for unsized array bin ‘data_range’ in Coverpoint ‘s_axis_data_tdata’ of Covergroup instance '/testbench_dpi/dc ’
This is the coverage model that I have made:
/*
covergroup data_cov; //makes sure all possible values are covered
coverpoint s_axis_data_tdata {
bins data_range[] = {[0 : $]};
}
endgroup
*/
covergroup data_cov;
coverpoint s_axis_data_tdata[63:0] {
bins all_zero_bin = {63'b0};
bins all_one_bin = {63'b1};
bins others = default;
}
endgroup
data_cov dc; //create instance of data coverage
initial begin : coverage
dc = new();
forever begin @(posedge clk);
dc.sample();
end
end : coverage
function bit [64:0] get_data(); //contains random stimulus for data input
bit [64:0] data_rand;
data_rand = $random;
return data_rand;
endfunction : get_data
You are getting this sort of error because you’ve asked for the unsized bin “data_range” to be created for all possible values across a 64-bit value (2^^64) bins which is very large and quite frankly is going to be impossible to cover in its entirety in any reasonable amount of time.
You would be better off defining bins that cover groups of input data values in some meaningful way that is appropriate for your design requirements. The alternative code you’ve got that uses “others = default” is a good approach if there are specific values and ranges for the input variable that are more meaningful than others; just sample for those in a manner similar to what you’ve started doing with the “all_zero_bin” and “all_one_bin”. Another approach would be to use a sized bin instead of unsized (use “data_range[32]”, for example, to equally distribute all possible values across just 32 bins).
By the way, your “get_data()” function will never return values above 2^^32. You’ll want to concatenate two calls to $urandom() together to return a full 64-bit random variable each time.
Thankyou very much for this advice! I have tried to do as you said, creating some more specific ranges of data with some sized bins- but I am still getting the same error. Is this more along the right lines?
covergroup data_cov;
coverpoint s_axis_data_tdata {
//bins all_zeros_bin[32] = {32'b0};
//bins all_ones_bin[32] = {32'b1};
bins data_range_real_a[64] = {['h01:'hFF]};
bins data_range_real_b[64] = {['h1FF:'hFFFF]};
bins data_range_real_c[64] = {['h1FFFF: 'hFFFFFF]};
//bins others[32] = default;
}
endgroup
data_cov dc; //create instance of data coverage
initial begin : coverage
dc = new();
forever begin @(posedge clk);
dc.sample();
end
end : coverage
function bit [64:0] get_data(); //contains random stimulus for data input
bit [64:0] data_rand;
data_rand = {$urandom(), $urandom()};
return data_rand;
endfunction : get_data