Why instantiation of an embedded covergroup is not allowed outside class constructor?
class abc;
bit x;
covergroup cg;
x1: coverpoint x;
endgroup
task run();
cg = new();
endtask
endclass
Compile is failing when i use above code as it is. but when i move “cg = new()” to constructor its working fine.