Bitwise toggle coverage for a bitvector

In reply to dave_59:

Hi Dave,

I am trying to execute this piece of code but it results in only one bin getting created(with address all 0’s) instead of 16. could you suggest what might be going wrong here? basically the address value assigned in the function is not seen by the covergroup. Is there any other way i could do this?

Code is as follows:

class xyz ;

bit[31:0] address;
bit[31:0] ADDR;

covergroup access();

addr : coverpoint ADDR { bins Addr[16] = {[0:address]}};  

endgroup

function void calc();

address = 'h10000;
access.sample();

endfunction

fucntion new();

access = new();

endfunction

task run();

 forever begin
    calc();
end

endtask