verilog changing random seed
12,993
You can change the seed using a flag like this:
irun -seed seed_number
Or you can use a random seed:
irun -seed random
I'm pretty sure every tool (Questa and VCS) has an option to do this. If you don't set a seed, it will default to 1.
Related videos on Youtube
Author by
Rudy01
Updated on June 04, 2022Comments
-
Rudy01 almost 2 years
How do I change the seed for
$urandom_range
every time I am starting a new simulation. I tried so many things non worked.always@(posedge tb_rd_clkh) begin $random(9); tbo9_ready_toggle_q <= $urandom_range(0, 1); end
-
dave_59 almost 9 yearsWhat do you think
$random(9);
is supposed to mean? -
dolphus333 almost 9 yearsAre you asking how to get a different seed for each simulation?
-
-
Rudy01 almost 9 yearsThanks, but how come it is not working in always statement? I did the same thing like below, but it didn't work: always@(posedge tb_rd_clkh) begin seed <= 3; rand_gen <= $urandom(seed); tbo9_ready_toggle_q <= $urandom_range(0, 1); end
-
Emman almost 9 yearsA different approach needs to be followed for always block, you can use the method mentioned in the updated answer