Posted on 2011-05-13 by Philippe Faes
Last modified on 2024-10-29
Tagged as: EmacsVHDLScreencast

VHDL Emacs mode navigation using ctags are broken

In my series of how Sigasi is better than Emacs VHDL mode , we want to demonstrate that Emacs VHDL mode is becoming outdated. I do this by comparing relevant and technical features of the Emacs VHDL mode and Sigasi.

(I also realize that relevant and technical comparison will not be enough to convince those who are deeply infatuated.)

Today: finding a declaration

Finding a declaration is useful. Anybody who has access to this features uses it all day long, every day. People who do not have access to this feature do it manually. Imagine finding the declaration of a datatype or a constant. Even in a modest project (say 20 files of 500 lines) it is hard to keep track of all declarations in your head.

Emacs VHDL mode

Emacs cleverly uses ctags / etags. This tool creates an index of all declarations in a project. If you want to navigate to a declaration, Emacs searches this index to find out in which file and on which line something is declared. Ctags was a great innovation in its day, but it is becoming obsolete. Ctags finds declarations based on regular expressions (regex). It does not take proper scoping rules into account. Problems arise when the same name gets used more than once, or when your coding style happens to confuse the regexes.

Sigasi

Any modern VHDL design entry tool should use a proper VHDL analyser (or: parser). Only a full analysis of the source code can provide robust navigation. I’ve posted a screencast about Power navigation for VHDL state machines a while ago.

Demoing Emacs

Here is a screencast that demonstrates what works and what does not work with Emacs VHDL mode and etags.

Should there be anything technically incorrect in this post, please feel free to send us an email .

See also