BartlebyScrivener
Member level 5
- Joined
- Feb 8, 2012
- Messages
- 90
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 2,081
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.