I have a testcase in verilog to program different register using randomization.
The value is given to a register as below:
initial begin
repeat(100) begin
reg[19:14] = $urandom_range(0,48);
end
end
so reg is getting assigned with values between 0 and 48.I want the reg to be assigned with all values between 0 and 48 like randc in system verilog.This to achieve full toggle coverage.
Can anybody help me?
Put the values 0 -48 in an array, and then call array.shuffle(). You might want to declare the array as a queue so you can push the values in order, shuffle, then pop them off the queue.