Why does this coverpoint bin keep getting excluded?



logic [21:0] address;

covergroup cgp;
        logic [21:0] m_addr : coverpoint address {
                bins odd             = {['h000000:'h3FFFFF]} with (item % 2 == 1);
                bins even            = m_addr with (item % 2 == 0);
	}
endgroup


I keep getting a warning that the coverpoint gets empty coverage bins for the odd and even bins.

** Warning: (vsim-8858) After processing coverbin with/set expression, the values list associated with scalar bin ‘odd’ in Coverpoint ‘m_addr’ of Covergroup instance ‘’ has converged to empty list. The bin will be taken out of coverage calculation.

** Warning: (vsim-8858) After processing coverbin with/set expression, the values list associated with scalar bin ‘even’ in Coverpoint ‘m_addr’ of Covergroup instance ‘’ has converged to empty list. The bin will be taken out of coverage calculation.

Why am I getting empty coverbins with this covergroup? Am I mixing up types?

In reply to ce_2015:

I think your m_addr is cover_point_identifier, not a coverpoint signal.
cover_point ::= // from A.2.11
[ cover_point_identifier : ] coverpoint expression [ iff ( expression ) ] bins_or_empty


covergroup cgp;
        m_addr : coverpoint address {
                bins odd             = address  with {item % 2 == 1};
                bins even            = address  with {item % 2 == 0};
	}
endgroup

In reply to javatea:

In reply to ce_2015:
I think your m_addr is cover_point_identifier, not a coverpoint signal.
cover_point ::= // from A.2.11
[ cover_point_identifier : ] coverpoint expression [ iff ( expression ) ] bins_or_empty


covergroup cgp;
m_addr : coverpoint address {
bins odd             = address  with {item % 2 == 1};
bins even            = address  with {item % 2 == 0};
}
endgroup

Your reply would make sense but for the fact that the warning is issued for the odd bins also (which doesn’t use the ‘m_addr’ for its bins definition).

As I have simulated more, it appears that my tool has a built-in fail-safe warning if the address range is too large. Sorting the 2^21 addresses into odd and even bins is time consuming so I have had to explore other options.

Thanks!

In reply to ce_2015:

Why not just cover the LSB of the address

covergroup cgp;
        m_addr : coverpoint address[0] {
                bins odd             = {1};
                bins even            = {0};
	}
endgroup


I you are looking to care a range of even and odd addresses, then you may want to bin them into ranges

covergroup cgp;
        m_addr : coverpoint address[0] {
                bins odd             = {1};
                bins even            = {0};
	}
        r_addr: coverpoint address[21:1] {
               bins range[128] = {[0:$]}; / divides address range into 128 segments
        }
        cross m_addr, r_addr;
endgroup