class C;
rand int a;
constraint con1{a==0;}
endclass
class D extends C;
constraint con1{a==10;}
endclass
module top;
C c;
D d = new;
initial begin
c = d;
c.randomize();
$display(c.a);
d.randomize();
$display(c.a);
end
endmodule
The output for both the dispaly is 10 ie constraints seems to work like virtual.
But the SV LRM states that the randomize function is virtual not constraint block.
I am not able to understand how virtual randomize function is creating the above scenario.