UVM coverage question

Hi ,

I want to write covergroup to check coverage for 16bit register. I want to make sure that all 15 bits transition to “1” state at least once . It can be together or at different time but each bit should go to “1” at least once.

I tried with this but it didnt work. Out of 16 values it only covered for 0. Even though i did see my register going to different values.mac_xoff is 16bit register I want the coverage for.

covergroup mac_nbi_port_xoff_cg;

  //coverpoint to check if Xoff is asserted on all ports
  
  port_xoff: coverpoint port_xoff.mac_xoff {
	 bins mac_xoff[]= {[0:15]};
  }

endgroup

In reply to manavshah33:
A brute-force approach would be

covergroup mac_nbi_port_xoff_cg;
port_xoff: coverpoint port_xoff.mac_xoff {
wildcard bins b0 = {16'b????????_???????1};
wildcard bins b1 = {16'b????????_??????1?};
wildcard bins b2 = {16'b????????_?????1??};
...
wildcard bins b15 = {16'b1???????_????????};
}

A more parameterizable approach is to use an array of covergroups

covergroup cgbits(input int position, ref bit [15:0] vector);
  pos: coverpoint ((15'b1 << position) & vector) !=0;
  option.per_instance = 1;
endgroup
 
cgbits eachbit[16];
 
foreach (eachbit[i]) eachbit[i] = new(i, port_xoff.mac_xoff);