Verilog - Race Conditions

Race Conditions

The order of execution isn't always guaranteed within Verilog. This can best be illustrated by a classic example. Consider the code snippet below:

initial a = 0; initial b = a; initial begin #1; $display("Value a=%b Value of b=%b",a,b); end

What will be printed out for the values of a and b? Depending on the order of execution of the initial blocks, it could be zero and zero, or alternately zero and some other arbitrary uninitialized value. The $display statement will always execute after both assignment blocks have completed, due to the #1 delay.

Read more about this topic:  Verilog

Famous quotes containing the words race and/or conditions:

    In the race for wealth, a neighbor tries to outdo his neighbor, but this strife is good for men. For the potter envies potter, and the carpenter the carpenter, and the beggar rivals the beggar, and the singer the singer.
    Hesiod (c. 8th century B.C.)

    Technological change defines the horizon of our material world as it shapes the limiting conditions of what is possible and what is barely imaginable. It erodes ... assumptions about the nature of our reality, the “pattern” in which we dwell, and lays open new choices.
    Shoshana Zuboff (b. 1951)