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:

    What is all wisdom save a collection of platitudes? Take fifty of our current proverbial sayings—they are so trite, so threadbare, that we can hardly bring our lips to utter them. None the less they embody the concentrated experience of the race and the man who orders his life according to their teaching cannot go far wrong.
    Norman Douglas (1868–1952)

    There is no society known where a more or less developed criminality is not found under different forms. No people exists whose morality is not daily infringed upon. We must therefore call crime necessary and declare that it cannot be non-existent, that the fundamental conditions of social organization, as they are understood, logically imply it.
    Emile Durkheim (1858–1917)