hi,
i have data signal which need to be randomized for which i need to padd the number of zeros.
rand [31:0] data;
example: number of zeros to be padded to data is 5 so that my data look like data = 32’b00000111101110101011101101110001
If you mean you need to pad the MSBs with a certain amount of zeros, you can shift right in post_randomize()
data >>= shift_r;
You can also to the shift as part of the constraint by adding an extra random variable.
rand bit [31:0] data, temp;
rand int shift_r;
constraint c {
shift_r inside {[0:5]};
data == (temp >> shift_r);
}