Which distribution does randomization consider base or extended?

HI Ashith,

As you have written two constraint for same variable, with two different name.One in Parent class and second in Extended class.

So, Constraint solver try to satisfy both the distribution.

If you had written code like that,

class BASE_A;
rand [3:0] bit Var1;

constraint Var1_c {
Var1 dist {
0 := 10,
[1:7] := 10,
[8:15] := 10 
}
}

endclass

class Ext_A extends BASE_A;

constraint Var1_c {
Var1 dist {
0 := 5,
[1:7] := 20,
[8:15] := 5 
}
}

endclass

Here both the constraint has same name. so Constraint will be overridden and constraint solver try to satisfy constraint which you have written in Extended class.