Using solve before with equal , overlapping values

Hi all ,

Though this forum I see that solve before constraint solve before has no effect when we have equal non-overlapping values .

I have a sample code with Equal , Overlapping Values ::


  
  typedef enum bit [3:0] { SET1, SET2, SET3 } e_sets ;
  rand e_sets      set; 
  rand bit [7:0]  inst;   
  
  constraint SET_INST {  set==SET1 -> inst inside {[0:2]}; 
	                 set==SET2 -> inst inside {[1:3]};
	                 set==SET3 -> inst inside {[2:4]};}



So without solve before I have the following ::


  
Solution space
set   inst   Probability 
SET1  0       (1/9)
SET1  1       (1/9)
SET1  2       (1/9)
SET2  1       (1/9)
SET2  2       (1/9)
SET2  3       (1/9)
SET3  2       (1/9)
SET3  3       (1/9)
SET3  4       (1/9)

  

If I add solve set before inst constraint ::


  
Solution space unchanged . Probability remains the same !!
set   inst   Probability 
SET1  0       (1/3)X(1/3)
SET1  1       (1/3)X(1/3)
SET1  2       (1/3)X(1/3)
SET2  1       (1/3)X(1/3)
SET2  2       (1/3)X(1/3)
SET2  3       (1/3)X(1/3)
SET3  2       (1/3)X(1/3)
SET3  3       (1/3)X(1/3)
SET3  4       (1/3)X(1/3)

  

[A] Am I right with the above table , especially the probability part ?

Similarly if I were to either write solve inst before set constraint ;


  
Solution space unchanged but Probability Changes 
 inst   set   Probability 
  0     SET1   (1/5)X1
  1     SET1   (1/5)X(1/2)
  2     SET1   (1/5)X(1/3)
  1     SET2   (1/5)X(1/2)
  2     SET2   (1/5)X(1/3)
  3     SET2   (1/5)X(1/2)
  2     SET3   (1/5)X(1/3)
  3     SET3   (1/5)X(1/2)
  4     SET3   (1/5)X 1


  

[B] Is the probability correct ?

[C] Also If I were to use any solve before construct,how do I observe the above probability ? As in if I call randomize() method 9 times its not compulsory that the above probability occurs .

Thanks ,

In reply to Have_A_Doubt:

Your probability calculations are correct for the solutions as a whole.

You would have to call randomize many more times to observe these probabilities. See randomisation_dist | Verification Academy