Can we randomize 2-D array using std::randomize()?


//constraint u_a0 {foreach (a[i]) unique {a[i]}; } //unable to use foreach on this for some reason

I would prefer something like above, instead of unrolling - your simulator might support…or am I missing something ?

output for 3 loops above

a is '{'h3, 'h1, 'h0, 'h2}
a is '{'h2, 'h0, 'h3, 'h1}
a is '{'h0, 'h2, 'h1, 'h3}
a is '{'h1, 'h3, 'h2, 'h0}

a is '{'h1, 'h0, 'h3, 'h2}
a is '{'h2, 'h3, 'h1, 'h0}
a is '{'h3, 'h2, 'h0, 'h1}
a is '{'h0, 'h1, 'h2, 'h3}

a is '{'h3, 'h2, 'h0, 'h1}
a is '{'h2, 'h3, 'h1, 'h0}
a is '{'h0, 'h1, 'h2, 'h3}
a is '{'h1, 'h0, 'h3, 'h2}