5
\$\begingroup\$

What is the difference between always @* and always @(*) in Verilog-2001?

travisbartley
4,9133 gold badges26 silver badges41 bronze badges
asked Mar 27, 2013 at 23:07
\$\endgroup\$

2 Answers 2

11
\$\begingroup\$

There is no difference, they mean exactly the same thing: infer my sensitivity list from the contents of the block.

answered Mar 27, 2013 at 23:17
\$\endgroup\$
3
  • 1
    \$\begingroup\$ Is one considered better practice? I've only ever come across the parenthesized version \$\endgroup\$ Commented Mar 28, 2013 at 15:50
  • \$\begingroup\$ @Eric, it is up to the designer to choose whichever one he wants to use. There is no known bug or pitfall associated with either syntax. The parentheses are unnecessary if using an inferred sensitivity list. But if it causes confusion it is better just to use the parentheses as it causes no harm. \$\endgroup\$ Commented Jul 17, 2013 at 1:51
  • \$\begingroup\$ Here is a nice Verilog-2001 source: sutherland-hdl.com/online_verilog_ref_guide/… \$\endgroup\$ Commented Jul 17, 2013 at 1:52
2
\$\begingroup\$

There are the same, but the better syntax is to use always_comb in SystemVerilog.

It's better for synthesis because it has syntax restrictions for synthesis that will be caught during compilation of any tool, like a simulator. You won't have to wait until you try to synthesize and find out that your always block is not combinatorial. It also is better at picking up sensitivities from function calls.

It's also better for simulation because always_comb guarantees that it will execute at time 0. That becomes critical when one of the signals on the sensitivity list turns out to be a constant and the other signals do not get initialized or have any events on them right away. For example

parameter en = 0; reg o1, o2; reg data;

always @(*) o1 = en & data; always_comb o2 = en & data;

o1 will remain 1'bx until data changes, whereas o2 will go to 1'b0 at time 0.

answered Oct 11, 2014 at 16:11
\$\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.