openvera allows to control the order of randomization variables.The solution space remains the same,but the probabulity of picking up the values changes.the syntax for variable ordering is "solve x before y".The exact meaning of this statement is "choos x befor y" as the this state ment if to guide the distribution,but not the solution space.
Only rand variables are allowed.
EXAMPLE: class Var_order{
randbit a;
randbit [3:0] b;
constraint bidirectional { a -> b == 0; }}
The probabulity of a=1 is 1/2**5,as bidirectional constraints are solved at once,the solver pics the random value from the possible set of {a,b} which has 2**5 solutions.To make the probability of a= 0 to 50% and a = 1 to 50% ,use
constraint order { solve Var1 before Var2 ;}
This guides the solver to give highest priority to Var1 than Var2.This is explicit variable ordaring.The solver follows the implicit variable ordaring also,like randc are solved before rand variables,in dynamix arrays size and elements are solved with two constraints,and size is solved before element.
class var_order{
randbit Var;
randbit [3:0] b;
constraint c { if(Var == 0) (b == 1); }
constraint order { solve Var before b ;}
Too many explicit variable ordering may lead to circular dependency.The LRM says that "Circular dependencies created by the implicit variable ordering shall result in an error." and "circular dependency is not allowed".
But it does not put restriction on what to do if a explicit circular dependency exists.Check with your tool,if explicit Circular dependency is existing,it may report warning,it may fail solver or proceed by just ignoring the order.
EXAMPLE: program Cir_Dip_p{
class Cir_Dep;
randinteger a,b,c;
constraint a_c { solve a before b ;}
constraint b_c { solve b before c ;}
constraint c_c { solve c before a ;}
}