stanford
Full Member level 2
- Joined
- Feb 16, 2014
- Messages
- 132
- Helped
- 4
- Reputation
- 8
- Reaction score
- 6
- Trophy points
- 1,298
- Activity points
- 2,223
Why is it that if you use blocking assignments, you have a race, but if you use non-blocking, you don't have a race? See below example.
initial begin // has race condition.
reset = 1’b0;
#20 reset = 1’b1;
#40 reset = 1’b0;
end
initial begin // no race condition.
reset <= 1’b0;
#20 reset <= 1’b1;
#40 reset <= 1’b0;
end
initial begin // has race condition.
reset = 1’b0;
#20 reset = 1’b1;
#40 reset = 1’b0;
end
initial begin // no race condition.
reset <= 1’b0;
#20 reset <= 1’b1;
#40 reset <= 1’b0;
end