In reply to Mihaelf:
My simulator reports the following error:
randomize() failed due to conflicts between the following constraints:
cyclic_array.sv(5): c_range { (arr[1] inside { [1:3] }); }
cyclic_array.sv(10): c_sorted { if ((1 > 0)) {(arr[1] > arr[(1 - 1)]);} }
I changed to last constraint to
constraint c_sorted {
foreach (arr[i])
if (i>0)
arr [i] != arr[i-1] ;
}
The simulation output is