Hi Forum,
Consider the following constraint
class Dist;
rand bit [3:0] dst;
constraint DIST1 { dst dist { 5:=1 , [12:15]:=1 }; }
//constraint DIST2 { dst dist { 10:=1 }; }
//constraint DIST3 { dst dist { 15:=2 }; }
endclass
On randomizing an object of Dist, 20 times I observe ::
(1) On uncommenting DIST2 there is a constraint failure as the value of 10 isn’t legal as per DIST1
(2) On uncommenting DIST3 I observe that dst always takes value as 15 ( all 20 times )
[Q] Shouldn’t dst also be randomized ( with lesser probability ) to value of 5 / 12 / 13 / 14 ?
Thanks