In reply to ritheshraj:
I explained this to you a few days ago.
BTW, the code you entered does not use non-blocking assignments. But assuming that was a typo, in the example here, there is no process reading “q”, so there is no race condition.
However, there is a race condition in the initial block assigments to ‘d’. Sometimes, you change the value of clk at the same time you are changing the value of clk. There is no guarantee if the always block in the D flop module reads the old or new value of d. Using non-blocking assignments to d guarantees it sees the old value.