Hello
I want to create unique values in an array. I understand SV provides unique construct to do such a thing. However I want to constraint those array values further between 2 values.
class Nibbleset
rand bit [3:0] nibbles[10];
constraint uniq {unique {nibbles};}
endclass
Problem here is that values are constrained by size of each entry which is 4 bit. So each value can be between 0 and 15. if I want say unsized array or queue with randomized size and unique values between integer a and b, is there construct which comes with unique ?
rand logic [4:0] d_arr[$];
constraint uniq {d_arr.size < 7;
unique {d_array}}
Something in 2nd code to say please choose value between 7 and 30 ?