BartlebyScrivener
Member level 5
I am trying to create a new 5 bit number every rising clk edge in my test bench. I have written the following.
But it only appears to create a random number once, and not on every clock edge.
What am I misunderstanding?
Many thanks.
Code:
always_ff@(posedge clk) begin
if(~reset_n) begin
i_request <= 0;
end else begin
i_request <= $dist_uniform(0, 0, 32);
end
end
But it only appears to create a random number once, and not on every clock edge.
What am I misunderstanding?
Many thanks.