In reply to dave_59:
@dave_59 - If ‘data’ is not declared as rand, will pre_randomize be called? In the above case, we can shift the initialization and shuffle part to post_randomize.
class A;
rand bit [11:0] data_in [99:0];
constraint data_range { foreach(data[i]) data_in[i] inside {[0:500]}; }
endclass
I want to make sure that all the 100 elements in ‘data_in’ are unique 12 bit values.