Functional coverage for associative array of enums

Hello,
I have the following associative array that I am trying to generate coverage for. I would like to only have bins for the values specified. This is an attempt to streamline coverage in my process.

I am passing the following define into the sim:

DRAM_TYPE_FREQ_ARR='{eDDR4:'{eDDR_FREQ_800,eDDR_FREQ_1067},eLPDDR4:'{eDDR_FREQ_1467,eDDR_FREQ_2133}}

My fcov class looks like this, I have removed failed attempts to accomplish my goal:

class one_hot_x_dram_type_x_dram_speed_fcov#(int WIDTH=16, bit [WIDTH-1:0] ignore_vec=0);
   
   eFREQ_TYPE freq_arr[eDramTech][] = `DRAM_TYPE_FREQ_ARR;

   function void sample_one_hot(bit[WIDTH-1:0] vec, eDramTech dram, eFREQ_TYPE freq);
      for(int i = 0; i < WIDTH; i++) begin
	 cg__one_hot_x_dram.sample(vec, i, dram, freq);
      end
   endfunction

   function bit is_bin(int val);
      return !ignore_vec[val];
   endfunction // is_bin

   covergroup cg__one_hot_x_dram with function sample(bit[WIDTH-1:0] x, int position, eDramTech dram_type_loc, eFREQ_TYPE dram_freq_loc);

      cp__one_hot_vector : coverpoint position iff(x[position] == 1 && $onehot(x)) { 
	 bins vec[] = {[0:WIDTH-1]} with (is_bin(item));
      }

   endgroup // cg__one_hot

   function new(string name="one_hot_x_dram_type_x_freq");
     cg__one_hot_x_dram = new();
   endfunction // new

endclass // one_hot_x_dram_type_fcov

My goal is to only create bins to be used in a cross that fall within the type-speed combinations in the associative array. I would like to only have to modify the defined associative array to add or take away combinations without having to modify any code. I have been successful in using only an array for each, but the cross generates unnecessary bins that have to be waived in coverage analysis.

I would appreciate thoughts or suggestions on how to accomplish this.

Thanks

In reply to peter.r:

I have come up with this:

      cp__dram_type : coverpoint dram_type_loc {
	 bins dram_tech[] = dram_type_loc_q;
      }

      cp__dram_freq : coverpoint dram_freq_loc {
	 bins dram_freq[] = dram_freq_loc_q;
      }

      cr_one_hot_x_dram_x_freq_x_type : cross cp__one_hot_vector, cp__dram_type, cp__dram_freq {
	 function CrossQueueType cr_func();
	    for(int i = 0; i<WIDTH; i++) begin
	       foreach(freq_arr[j]) begin
           	  for(int k = 0; k < freq_arr[j].size(); k++) begin
	             cr_func.push_front('{i,j,freq_arr[j][k]});
                  end
               end										
            end
         endfunction
	 
	 bins cr  = cr_func();
      }

   endgroup // cg__one_hot

   function new(string name="one_hot_x_dram_type_x_freq");
      foreach(freq_arr[i]) begin
	 dram_type_loc_q.push_back(i);
	 for(int j = 0; j < freq_arr[i].size(); j++)
	   dram_freq_loc_q.push_back(freq_arr[i][j]);
      end
      cg__one_hot_x_dram = new();
   endfunction // new

Printing the result of cr_func yields:

cr_func = 
...
...
'{cp__one_hot_vector:2, cp__dram_type:eLPDDR4, cp__dram_freq:eDDR_FREQ_2133},
'{cp__one_hot_vector:2, cp__dram_type:eLPDDR4, cp__dram_freq:eDDR_FREQ_1467},
'{cp__one_hot_vector:2, cp__dram_type:eDDR4, cp__dram_freq:eDDR_FREQ_1067},
'{cp__one_hot_vector:2, cp__dram_type:eDDR4, cp__dram_freq:eDDR_FREQ_800},
'{cp__one_hot_vector:1, cp__dram_type:eLPDDR4, cp__dram_freq:eDDR_FREQ_2133},
'{cp__one_hot_vector:1, cp__dram_type:eLPDDR4, cp__dram_freq:eDDR_FREQ_1467},
'{cp__one_hot_vector:1, cp__dram_type:eDDR4, cp__dram_freq:eDDR_FREQ_1067},
'{cp__one_hot_vector:1, cp__dram_type:eDDR4, cp__dram_freq:eDDR_FREQ_800},
'{cp__one_hot_vector:0, cp__dram_type:eLPDDR4, cp__dram_freq:eDDR_FREQ_2133},
'{cp__one_hot_vector:0, cp__dram_type:eLPDDR4, cp__dram_freq:eDDR_FREQ_1467},
'{cp__one_hot_vector:0, cp__dram_type:eDDR4, cp__dram_freq:eDDR_FREQ_1067},
'{cp__one_hot_vector:0, cp__dram_type:eDDR4, cp__dram_freq:eDDR_FREQ_800}}

But cr has only one bin, and the remaining bins are listed in the coverage tool. I was expecting cr to have the bins I wanted, but it seems it behaving like ignore_bins.

In reply to peter.r:

I have figured this out. I was misinterpreting the LRM and the creation of bins. What I have come up with is to use a function to create the ignore_bins. There is probably a better way to do this, but this does what I need it to.

      cr_one_hot_x_dram_x_freq_x_type : cross cp__one_hot_vector, cp__dram_type, cp__dram_freq {
	 function CrossQueueType cr_func();
	    for(int i = 0; i<WIDTH; i++) begin
	       foreach(dram_type_loc_q[j]) begin
	          foreach(dram_freq_loc_q[k]) begin
	             if(freq_arr[dram_type_loc_q[j]].find() with (item == dram_freq_loc_q[k]) == {}) 
                        cr_func.push_back('{i,dram_type_loc_q[j],dram_freq_loc_q[k]});
                  end
               end
            end
         endfunction
	 
	 ignore_bins cr = cr_func();
      }