1
\$\begingroup\$

I sometimes make mistake when changing VHDL code to add new functionality that, the new signals added into the VHDL process are not reset when the reset state is asserted. This mistake could be quite harmless sometimes but at other times it can lead to design failure in simulation or even hardware.

What tool do I use to ensure that all signals and variables used inside a process are assigned an initial value in the process, maybe when reset is asserted or maybe every clock cycle?

\$\endgroup\$

3 Answers 3

3
\$\begingroup\$

There are industry-standard formal verification tools like QuestaSim Autocheck which can be used for variety of static and dynamic checks on various aspects of RTL design at the earlier stages of development, without the need of a simulation test bench.

Reset values of registers is one of the many checks supported by the tool.

\$\endgroup\$
9
  • \$\begingroup\$ Have you used this tool at all? \$\endgroup\$
    – quantum231
    Commented Jul 25, 2021 at 20:46
  • \$\begingroup\$ Yea. It was the tool we used for formally verifying the designs before proceeding to the test bench based verification. There by easing the verification speed. So, the reason for downvoting? \$\endgroup\$
    – Mitu Raj
    Commented Jul 26, 2021 at 4:11
  • \$\begingroup\$ It was by mistake, I upvoted it, clicked on the wrong button it seems :| \$\endgroup\$
    – quantum231
    Commented Jul 26, 2021 at 14:28
  • \$\begingroup\$ Ha ?! Okay ... You can revert it then \$\endgroup\$
    – Mitu Raj
    Commented Jul 26, 2021 at 14:43
  • \$\begingroup\$ I tried, it says "You last voted on this answer 23 hours ago. Your vote is now locked in unless this answer is edited." \$\endgroup\$
    – quantum231
    Commented Jul 26, 2021 at 20:12
4
\$\begingroup\$

What tool do I use to ensure that all signals and variables used inside a process are assigned an initial value in the process, maybe when reset is asserted or maybe every clock cycle?

Same as every other test: you write a testbench that checks for defined value.

\$\endgroup\$
4
  • \$\begingroup\$ No, what I meant is, if there is a tool that can perform static checks on the code itself by reading through it. \$\endgroup\$
    – quantum231
    Commented Jul 22, 2021 at 13:49
  • \$\begingroup\$ how is that tool to know what to look for? You need to tell it. That's a test case. You write a test case. \$\endgroup\$ Commented Jul 22, 2021 at 14:02
  • 1
    \$\begingroup\$ I have used linting tools with Python, they work quite well. There are also linting tools for other higher programming languages. I don't know what decent tool exists for VHDL. A linting tool can detect such mistakes. A linting tool has profile that describes what is considered to be valid and invalid (but syntactically correct) VHDL. There should be default profiles in such a tool that can be used in most cases. \$\endgroup\$
    – quantum231
    Commented Jul 22, 2021 at 15:08
  • 1
    \$\begingroup\$ @quantum231 I fullheartedly agree, this is something that you should be able to lint in every sensible language, but I'm not convinced VHDL is that sensible :( \$\endgroup\$ Commented Jul 22, 2021 at 15:48
1
\$\begingroup\$

I don't have any tool to suggest but possible check by simulation.

I do a visual inspection on simulation waveforms at unit testing. Before asserting the reset, they are all undefined (easy to see - in red). After the reset asserted, they are initialized (see them in green). When one is not reset by mistake it is quickly found scrolling all signals.

That works well for my designs in which the coding rule is to reset all signals (even if not always recommended).

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.