Bitwise toggle coverage for a bitvector

In reply to albert:

The value of ADDR is read when calling the covergroup’s constructor. That is when the bins for the coverpoint are created. There is no more bin creation after constructing the covergroup.

So if ADDR has the value 0 when executing the statement

 access = new(address);

Then

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

will be interpreted as

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

which creates one one bin for the value 0.

You should have gotten a warning like

** Warning: (vsim-8546) The number of values specified ‘1’ is less than the size ‘16’ of fixed-size array bin ‘Addr’ in Coverpoint ‘addr’ of Covergroup instance '/top/xyz::access '. The ‘15’ empty bins will not contribute towards coverage.