Hi All,
I was reading a book in which there is a description of the SystemVerilog Constraint Solver. Please consider the below code:
class SolveBefore;
rand bit x; // 0 or 1
rand bit [1:0] y; // 0, 1, 2, or 3
constraint c_xy {
(x==0) -> y==0;
solve x before y;
}
endclass
The probability distribution is as follows (The last column denotes the probability):
Solution x y Probability
A 0 0 1/2
B 0 1 0
C 0 2 0
D 0 3 0
E 1 0 1/8
F 1 1 1/8
G 1 2 1/8
H 1 3 1/8
Now instead of solve x before y, if I write it as solve y before x, the probabilities are as follows:
Solution x y Probability
A 0 0 1/8
B 0 1 0
C 0 2 0
D 0 3 0
E 1 0 1/8
F 1 1 1/4
G 1 2 1/4
H 1 3 1/4
Can anyone help me understand this behaviour?