1
\$\begingroup\$

I have usually seen VHDL keyword null being used in the others part VHDL case blocks. However, it also sometimes appears in else part of if statements. Unlike Python that requires us to use the keyword pass, I don't think VHDL has any such requirements.

On the other hand, I heard someone tell me once that the reason he uses the keyword null in the else part of VHDL if blocks is to prevent warnings from synthesis tools. I am personally not sure what he was talking about.

Is it important to use keyword null in VHDL for synthesis although it seems redundant and does not do anything? When do we actually need it in modern VHDL?

asked Aug 2, 2021 at 17:52
\$\endgroup\$
3
  • \$\begingroup\$ TL/DR : Documentation. See stackoverflow.com/questions/42876613/null-statement-in-vhdl and electronics.stackexchange.com/questions/379822/… \$\endgroup\$ Commented Aug 2, 2021 at 18:49
  • \$\begingroup\$ Simply an explicit way of describing "do nothing and I mean it". You don't need to use null in codes otherwise. \$\endgroup\$ Commented Aug 2, 2021 at 18:51
  • \$\begingroup\$ It is VHDL's equivalent to, "This page intentionally left blank". This ensures that people who maintain the code in the future do not worry that something was accidentally deleted. \$\endgroup\$ Commented Aug 2, 2021 at 19:03

1 Answer 1

4
\$\begingroup\$

I have been programming in VHDL for 12 years, and I have never found the use of null to be a requirement. There may be some older tools out there that require it, but I have yet to come across one.

null can be used to make your code more readable by explicitly stating that a certain condition doesn't do anything.

answered Aug 2, 2021 at 18:40
\$\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.