# Compile race caused by blocking assginment

**URL:** <https://verificationacademy.com/forums/t/compile-race-caused-by-blocking-assginment/38249>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Race-condition\
**Created:** [October 20, 2020, 8:01am UTC](https://verificationacademy.com/forums/t/compile-race-caused-by-blocking-assginment/38249 "2020-10-20T08:01:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongci](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/y/49beb7/32.png) [@yongci](https://verificationacademy.com/forums/u/yongci)\
**Post date:** [October 20, 2020, 8:01am UTC](https://verificationacademy.com/forums/t/compile-race-caused-by-blocking-assginment/38249/1 "2020-10-20T08:01:51Z")

</div>

I am confused by the race conditions,and i want to get a surely answer about the blow 2 questions of 2 statement:  
1.

```verilog
module xxx;
xxxxx

initial begin

    wait(posdge clk);
    error <= 1;

end
always @(posdege clk) begin
    if(error)begin
        interupt <= 1;
    end
end
endmodule

```

question 1:“eror\<=1” and “if(error)begin” there is no race conditions.is this right?

```verilog
module xxx;
xxxxx

initial begin

    wait(posdge clk);
    error = 1;

end
always @(posdege clk) begin
    if(error)begin
        interupt <= 1;
    end
end
endmodule

```

question 2:“eror=1” and “if(error)begin” here is a race conditions.is this right?

looking forward to your answer.

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [October 20, 2020, 3:43pm UTC](https://verificationacademy.com/forums/t/compile-race-caused-by-blocking-assginment/38249/2 "2020-10-20T15:43:30Z")

</div>

_In reply to [yongci](https://verificationacademy.com/forums/t/compile-race-caused-by-blocking-assginment/38249):_

Please use [code tags](https://verificationacademy.com/forums/announcements/please-format-your-code-code-and/code-tags) making your code easier to read. I have added them for you.

The try to show complete, runnable examples [Asking better questions on the Verification Academy Forums with EDAPlayground - Verification Horizons](https://blogs.sw.siemens.com/verificationhorizons/2020/04/29/forums-with-edaplayground/)
