Randomization of dynamic array using "with"

In reply to evilpascal:
The problem is as the error message tells you - constraint expressions need to be with integral expressions. An unpacked array is not an integral expression. you need to create a separate array, and then use a
foreach
loop and break the aggregate constraint into an set of integral constraints.

bit [7:0] set_arr;

set_arr = '{8'h11, 8'h22, 8'h33};
if(!seq.randomize() with {
  _num inside {[0:10]};
  foreach (set_arr[ii]) _arr[ii] == set_arr[ii];
}) begin
  `uvm_error("TST", "Randomization failed")
end