Regarding Embedded Covergroup

Hi Dave,
If following covergroup we will define in another class then it will work??
covergroup skew_val_cg (ref int skew_val_vl); // note the use of a ref argument
coverpoint skew_val_vl {
bins skew_range_1 = {[124:0]};
bins skew_range_2 = {[325:125]};
bins skew_range_3 = {[526:326]};
bins skew_range_oor = {[1100:929]};
}
endgroup : skew_val_cg
class my_class extends uvm_component;
int skew_val_vl[20];
skew_val_cg sv_cg[20];

function new(string name, uvm_component parent = null);
super.new(name, parent);
foreach(sv_cg[i])
sv_cg[i] = new(skew_val_vl[i]);
endfunction
endclass

Add

option.per_instance = 1;

to the covergroup.

Yes,dave that i know.But Suppose I want the covergroup instance 20 times than should i take it like follow example or not:

class cv1;
  covergroup skew_val_cg ; // note the use of a ref argument
     coverpoint skew_val_vl {
         bins skew_range_1 = {[124:0]};
         bins skew_range_2 = {[325:125]};
         bins skew_range_3 = {[526:326]};
         bins skew_range_or = {[1100:929]};
       }
 function new();
     skew_val_cg=new();
 endfunction
endclass

class my_class;
int skew_val_vl;
cv1 cv;
cv.kew_val_cg sv_cg[20];

function new();
 this.cv=new()
endfunction
endclass

In reply to p_patel:

You cannot declare an array of an embedded covergroup. See Creating new instances of a covergroup using an array. | Verification Academy