A UVM sequence item defines two random unsigned variables: rand bit [3:0] a; and rand bit [3:0] b;. The constraint is constraint c1 { a > b; solve a before b; }. What is the mathematical probability that the variable a resolves to the decimal value 15 (4'b1111) upon randomization?
The solve a before b construct forces the solver to pick a first from all possible values it can legally hold, ignoring the density of valid b values. Since b is unsigned 4-bit (0 to 15) and a > b, a cannot be 0. Therefore, the valid solution space for a is strictly {1, 2, 3... 15}, which is 15 distinct values. Because a is solved first, the solver picks uniformly from these 15 values. The probability of picking 15 is 1/15.