HI ,
can anyone help me to write constraint for following formulae
rand real depth;
rand logic [14:0] inc;
rand logic [12:0] mod;
rand logic [5:0] var1;
rand bit a;
depth= (mod*inc*5*100)/((2**15-1)*var1)
if a=0 depth should between 0.25 to 2
if a=1 depth should between 0.5 to 4.0
when i wrote constraint like this inside seq item
constraint c_a { (a==1'b0)-> depth inside { [0.25:2]};
(a==1'b1)-> depth inside { [0.5:4.0]};}
constraint c_depth { depth==(inc*(mod*100.0*5.0))/( (2**15-1)*var1);}
constraint c_solve_before { solve depth before a;}
showing error like
“The randomize method call failed. The unique id of the failed randomize call is 0.”
Thanks in advance
regards
venkat