stanford
Full Member level 2
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