I have requirement to cover mask values (variable mask values like every alternate bits are one, or every 2nd alternative bits 1 and so on) to the input variable.
The problem with below code it wont differentiate with each mask value.
covergroup cg_in31_with_mask with function sample ( bit [31:0] input_bit,int position, N);
cp_input31: coverpoint position iff(position%N==0) {
bins in31_loc[] = {[0:31]} iff(input_bit[position]==1);
}
endgroup
function void write_inputd(T tr);
input_bit = tr.input_bit_cov;
N = $urandom_range(1,10);
$display("random position bit set %d",N);
for(int i=0;i<32;i++)
cg_in31_mask.sample(input_bit,i,N);
endfunction