Q) Create an array with all the numbers from 0 to Size - 1 in random order and without duplicates.
Sol: rand bit [3:0] arr;
constraint c1{
arr.size = 6 // For example
foreach(arr[i])
arr[i] = i;
}
void post_randomize()
{
arr.shuffle();
}
Is there any other way to approach this problem?