0
\$\begingroup\$

Nearly all verilog books and blogs strongly suggest not to include blocking and unblocking assignment in same always block.

But sometimes I also saw some code that has both blocking and unblocking code in same block, it can still work fine in simulator.

So what is the deep reason for why not using them simultaneously ? What potential problem would be caused ?

asked Jan 18, 2017 at 9:22
\$\endgroup\$
1
  • \$\begingroup\$ As well as the correct answer below, its untidy. If you have an intent when writing code, it's easier to review if you're explicit about that intent. \$\endgroup\$ Commented Jan 18, 2017 at 11:18

1 Answer 1

2
\$\begingroup\$

The standard reason is that it can lead to differences in behaviour between simulation (which will do the blocking assignments in a proper 'blocking' sequential fashion) and synthesis (which will not do blocking assignments in synchronous blocks in the way you might hope).

Of course, those differences may not matter, and the design may work when synthesised anyway but you really don't want there to be any functional difference between synthesis and simulation.

answered Jan 18, 2017 at 9:28
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.