In reply to faigenboim:
The size of the array must be known before constructing any covergroups.
You could create an array of covergroups, one for each range. You just need to make sure that the each element of the array gets sampled, or only sample the covergroup array element that is in the range.
covergroup fxp_reg_access_cg(string maps_name, uvm_reg_addr_t maps_base, uvm_reg_addr_t maps_size) with function sample(uvm_reg_addr_t address );
option.per_instance = 1;
option.name = maps_name;
accessed_block_cp : coverpoint address {
bins maps_name[2] = {[ maps_base[2] : (maps_base[2] + maps_size[2] -1)]};
}
endgroup
fxp_reg_access_cg fxp_ra_cg[];
fxp_ra_cg = new[my_maps_name.size];
foreach(fxp_ra_cg[i]) fxp_ra_cg[i] = new(...);
Another option is creating a function map_range that returns a value 0 to N-1, where N is the size of the array. Then set up your coverpoint bins
accessed_block_cp : coverpoint map_range(address) {
bins maps[N] = {[0:N-1]};
}