VHDL Editor

Content

VHDL editors

In principle, a normal text editor would be sufficient to write VHDL code. But if you have to work with VHDL for a longer time, you will definitely profit from a good editor, since it can reduce your development time and spare your nerves. Here are some features that a really good editor should IMO have:
  • good syntax highlighting (not only keyword highlighting)
  • fold and expand blocks
  • syntax error highlighting during writing
  • intelligent code completion
  • refactoring: support in renaming signals, variables, ... and in moving or simplifying code, whereby all dependencies are automatically adapted
  • completely configurable: shortcuts, style, tab size, ...
  • optional: LiveTemplates (also called Insertion Templates)
Since the VHDL editor integrated in Xilinx ISE does hardly have any of these features, I decided to search for a better one. Some years ago when I was writing my diploma thesis, I could not find any good editor that supports the syntax error highlighting. In the meanwhile two really promising IDEs have been developed offering free acadamic as well as commercial licenses: Both editors provide the features that I've mentioned above and are constantly improved. Sadly, I missed the opportunity to test and compare both editors during the free beta testing program.

Of course, there are also open source alternatives, but AFAIK none of them support the syntax error highlighting. Anyway, Emacs / XEmacs seems to be one of the best editors for VHDL. Beside the platform independence Emacs can assert itself through a long list of features. In newer versions of Emacs (>= 20.4) the VHDL Mode is already part of the distribution. Just execute the following command in Emacs to load the module:
M-x vhdl-mode
Many thanks to Marc Franzmeier for his hint to XEmacs. A useful overview about more VHDL tools and editors can be found on the websites of the TAMS group at the University of Hamburg.

At the time I had to decide which VHDL editor I was going to use, I decided to use kate. There are several reasons for this decision. First of all, the commercial tools SimplifIDE and Sigasi HDT did not yet exist, and Emacs was a bit complicated in use (very hard to setup your favorite shortcuts, or learn completely new ones) and for my project I did not need certain features. But compared to Xilinx' VHDL editor kate has already some very useful advantages, e.g. the code completion and the better performance. But to work with kate more efficiently some features had to be added, e.g. the functionality to collapse and expand blocks. This is not really a serious problem, because you just need to edit the syntax highlighting files of katepart and improve it as you wish. No sooner said than done. In the next section you can see the features of my adapted version of the vhdl.xml and download it if you like.

Improved syntax highlighting for VHDL in kate, kwrite, ... (KTextEditor)

Features:
  • collapse and expand blocks:
    • entity
    • architecture
    • component
    • component-Instanzen
    • process
    • for
    • while
    • if
    • case
  • fast comment / uncomment selection or current line (via control+d)
  • highlighting of keywords, comments, operators, numerics, ...
General features of the KTextEditor:
  • matching bracket is highlighted ("[]", "{}", "()")
Installation: Download vhdl.xml and save it to ~/.kde/share/apps/katepart/syntax/

Screenshots:



Remark: I know this is still far from optimum, because the extremely important error highlighting is missing. But in some cases even this primitive syntax highlighting can be used to detect structural mistakes during editing:
  • typos in keywords
  • missing closing block elements
  • the popular syntax errors at the start / end of entitys, architectures or processes

Syntax highlighting for UCF files in kate, kwrite, ... (KTextEditor)

Installation: xilinx-ucf.xml and save it to ~/.kde/share/apps/katepart/syntax/

Screenshots: