VerilogCreator is a QtCreator based IDE for Verilog 2005
Branch: master
Clone or download
Latest commit 3665f0c Feb 10, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images v0.6.0: marker based code folding; highlighter fixes Jan 26, 2019
LICENSE.GPL2 initial publication Dec 21, 2018
LICENSE.GPL3 initial publication Dec 21, 2018
README.md completion assistant/autocompleter works Feb 1, 2019
VerilogCreator.json.in fixed crash Feb 10, 2019
VerilogCreator.pro
VerilogCreator.qrc v0.6.0: marker based code folding; highlighter fixes Jan 26, 2019
VlAutoCompleter.cpp completion assistant/autocompleter works Feb 1, 2019
VlAutoCompleter.h outliner widget and model; begin completer support Jan 28, 2019
VlCompletionAssistProvider.cpp completion assistant/autocompleter works Feb 1, 2019
VlCompletionAssistProvider.h completion assistant/autocompleter works Feb 1, 2019
VlConfigurationFactory.cpp initial publication Dec 21, 2018
VlConfigurationFactory.h initial publication Dec 21, 2018
VlConstants.cpp initial publication Dec 21, 2018
VlConstants.h initial publication Dec 21, 2018
VlEditor.cpp initial publication Dec 21, 2018
VlEditor.h initial publication Dec 21, 2018
VlEditor.mimetypes.xml initial publication Dec 21, 2018
VlEditorDocument.cpp v0.6.0: marker based code folding; highlighter fixes Jan 26, 2019
VlEditorDocument.h compatible with QTC 3.6.x Dec 31, 2018
VlEditorFactory.cpp completion assistant/autocompleter works Feb 1, 2019
VlEditorFactory.h
VlEditorWidget.cpp completion assistant/autocompleter works Feb 1, 2019
VlEditorWidget.h outliner widget and model; begin completer support Jan 28, 2019
VlHighlighter.cpp
VlHighlighter.h v0.6.0: marker based code folding; highlighter fixes Jan 26, 2019
VlHoverHandler.cpp initial publication Dec 21, 2018
VlHoverHandler.h initial publication Dec 21, 2018
VlIcarusConfiguration.cpp compatible with QTC 3.6.x Dec 31, 2018
VlIcarusConfiguration.h initial publication Dec 21, 2018
VlIndenter.cpp initial publication Dec 21, 2018
VlIndenter.h initial publication Dec 21, 2018
VlModelManager.cpp
VlModelManager.h module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlModuleLocator.cpp module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlModuleLocator.h module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlOutlineMdl.cpp outliner widget and model; begin completer support Jan 28, 2019
VlOutlineMdl.h
VlOutlineWidget.cpp outliner widget and model; begin completer support Jan 28, 2019
VlOutlineWidget.h outliner widget and model; begin completer support Jan 28, 2019
VlPlugin.cpp completion assistant/autocompleter works Feb 1, 2019
VlPlugin.h initial publication Dec 21, 2018
VlProject.cpp module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlProject.h module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlProjectFile.cpp initial publication Dec 21, 2018
VlProjectFile.h initial publication Dec 21, 2018
VlProjectManager.cpp QTC 4.5 compat attempt Jan 1, 2019
VlProjectManager.h QTC 4.5 compat attempt Jan 1, 2019
VlSymbolLocator.cpp module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlSymbolLocator.h module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlTclConfiguration.cpp module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlTclConfiguration.h module and symbol locator; refactoring, singleton TclEngine Jan 30, 2019
VlTclEngine.cpp completion assistant/autocompleter works Feb 1, 2019
VlTclEngine.h
VlVerilatorConfiguration.cpp compatible with QTC 3.6.x Dec 31, 2018
VlVerilatorConfiguration.h initial publication Dec 21, 2018
VlYosysConfiguration.cpp compatible with QTC 3.6.x Dec 31, 2018
VlYosysConfiguration.h initial publication Dec 21, 2018
verilogcreator_global.h initial publication Dec 21, 2018

README.md

icon

Welcome to VerilogCreator

VerilogCreator is a QtCreator plugin. It turns QtCreator into a Verilog 2005 IDE.

The plugin is still work in progress, but it already has enough functionality to analyze existing code bases or to develop new code. The current version supports Verilog 2005 syntax checking/coloring and semantic code navigation/highlighting; there are build configurations for Icarus, Verilator, Yosys and Tcl. Projects can be configured using a file format similar to qmake.

screenshot

screenshot

Implemented Features

  • Syntax highlighting (including ifdefed out blocks and markers)
  • Context sensitive code completer, see screenshot
  • Inline code warnings and errors
  • Parentheses and begin/end block matching/navigation
  • Hover tooltips
  • Follow symbol under cursor, follow includes (multi-file support)
  • Show where a symbol is used
  • Drop-down menu to jump to modules, module instances, functions and tasks in current file
  • Outline view; see screenshot
  • Module locator (global) and symbol locator (current document); see screenshot 1 and screenshot 2
  • Syntax based code folding and some other features supported by QtCreator, see http://doc.qt.io/qtcreator/
  • Marker based code folding (MBCF); use section markers like //{ and //}, or //> and //<; see screenshot 1 and screenshot 2
  • Project file to configure source files, include dirs, defines and libraries
  • Icarus Verilog build and run configuration; directly run compiler and simulator from within QtCreator
  • Verilator and Yosys build configurations; generate command files, optional arguments
  • Build configuration based on custom Tcl scripts which can access project configuration (e.g. to run Vivado commands)

Project file format

VerilogCreator can either open single verilog files or project configuration files with the suffix ".vlpro".

The vlpro file can be empty; in that case all Verilog files (default suffix ".v") located in the vlpro directory including subdirectories are assumed to be the source files of the project.

Vlpro files follow the same syntax as QtCreator pro files (see http://doc.qt.io/qt-5/qmake-project-files.html), but uses other variable names. The following variables are supported:

SRCFILES += /path/filename.v

SRCFILES += "/path with whitespace/filename.v"

SRCFILES += /firstpath/filename.v /secondpath/filename.v \
		/thirdpath_on_new_line/filename.v

SRCFILES += /directory_path1/ filename1.v filename2.v /directory_path2/ filename3.v filename4.v

The variable SRCFILES lets you add source files explicitly to your project. There are different syntax versions. You can add filenames with absolute or relative paths; if you add a directory path only then the following filenames are assumed to belong to the directory with the given path. Note that path/filenames including whitespace have to be quoted by " ". Also note that you can add more than one element to a line separated by whitespace and that a \ lets you continue on the next line; this applies to all variables.

SRCEXT = .v .vl .verilog

The SRCEXT variable can be used to override the expected suffix of verilog files. Default is ".v".

SRCDIRS += dirpath1 dirpath2 dirpath3*

SRCDIRS += dirpath4 -filename1 -filename2 dirpath5 -filename3

With the SRCDIRS variable it is possible to add all verilog files in a given directory. All files with a suffix specified in SRCEXT are considered. There are different syntax versions. You can add directories with absolute or relative path. If you postfix the path with an "*" then also all subdirectories are implicitly added. If you want to leave out certain files add the filename to the line prefixed with "-".

LIBFILES +=

LIBDIRS +=

LIBEXT =

These variables are used the same way as their SRC counterparts. Use them to add Verilog files which are used but not modified by the present project.

INCDIRS += dirpath1 dirpath2

The variable INCDIRS specifies where the parser looks for include files (included by the Verilog include compiler directive).

DEFINES += DISABLE_SV_ASSERTION "E203_PC_SIZE 24"

This has the same effect as the Verilog include compiler directive and affects all files. Note that also the syntax corresponds to Verilog defines; since Verilog uses whitespace to separate name and values you have to use quotes in the vlpro file. There is also a variable BUILD_UNDEFS by which defines can be deactivated in the command file generated for Icarus, Verilator and Yosys; you could for example define VERILATOR in the vlpro so VerilogCreator can see it but then use BUILD_UNDEFS = VERILATOR to avoid define warnings in Verilator.

TOPMOD = picosoc

Use TOPMOD to explicitly set the top-level module; this is useful in case there is more than one top-level module in the code base. VerilogCreator does not use this information but hands it over to Icarus, Verilator and Yosys.

Download Binaries

Pre-compiled versions of the VerilogCreator plugin can be downloaded for Windows, Linux and Macintosh as part of the QtcVerilog application.

See here to learn more: https://github.com/rochus-keller/QtcVerilog/blob/master/README.md

Build Steps

Follow these steps if you want to build VerilogCreator yourself:

  1. Make sure that QtCreator and the Qt base development package are installed on your system. VerilogCreator was developed and tested with QtCreator 3.4 and Qt 5.4 on Linux. It also compiles with QtCreator 3.6 and Qt 5.7, but not (yet) with QtCreator 4.x (see below). Instead of using QtCreator, you can also use QtcVerilog (see https://github.com/rochus-keller/QtcVerilog).
  2. Create a build directory; let's call it BUILD_DIR
  3. Download the VerilogCreator source code from https://github.com/rochus-keller/VerilogCreator/archive/master.zip and unpack it to the BUILD_DIR; rename the subdirectory to "VerilogCreator".
  4. Download the Verilog parser source code from https://github.com/rochus-keller/Verilog/archive/master.zip and unpack it to the BUILD_DIR; rename "Verilog-Master" to "Verilog".
  5. Download the appropriate version of the QtCreator source code from https://download.qt.io/official_releases/qtcreator/ and unpack it to the BUILD_DIR. Instead of the QtCreator source code you can also use the QtcCreator source code (see https://github.com/rochus-keller/QtcVerilog).
  6. In case you don't have the Tcl development package installed: download http://software.rochus-keller.info/tcl_headers.zip and unpack it to BUILD_DIR/tcl.
  7. Either set the QTC_SOURCE (path to the QtCreator/QtcVerilog source code directory) and QTC_BUILD (path to the QtCreator/QtcVerilog installation directory) environment variables or directly modify the QTCREATOR_SOURCES and IDE_BUILD_TREE variables in VerilogCreator.pro.
  8. Goto the BUILD_DIR/VerilogCreator subdirectory and execute QTDIR/bin/qmake VerilogCreator.pro (see the Qt documentation concerning QTDIR).
  9. Run make; after a couple of minutes the plugin is compiled and automatically deployed to the local QtCreator plugin directory (on Linux to ~/.local/share/data/QtProject/qtcreator/plugins/x.y.z/libVerilogCreator.so) or directly to QtcVerilog.
  10. Start QtCreator/QtcVerilog and check in the "Help/About Plugins..." dialog (section "Other Languages") that the plugin is activated.

Instead of using qmake and make you can open VerilogCreator.pro using QtCreator and build it there.

Note that on Windows you also have to compile QtCreator/QtcVerilog itself because you also need the lib files for the plugin dll's (i.e. Core.lib, TextEditor.lib and ProjectExplorer.lib). Compiling QtCreator is not an easy task; compiling QtcVerilog is much easier.

State of Development

Even though I'm using Qt for twenty years and QtCreator for ten years this is my first noteworthy QtCreator plugin. Of course I read all available documentation and watched all available lectures. But still the available information is very sparse, of lesser quality than the Qt documentation and often outdated. So I had to invest half the development time in reverse engineering of the QtCreator 3.4 source code. I don't use QtCreator 4.x yet because I'm working on Ubuntu LTS versions which only have QtCreator 3.x packages and also because I'm fully satisfied with 3.x and the more recent versions run slower and consume more resources.

I'm aware of the Binary and Source Compatibility rules of QtCreator plugins and managed to make the source code compatible with QtCreator 3.4.x to the latest 3.6.1 using ifdefs. But in QtCreator 4.x they not only have changed some function signatures, but also the architecture to a considerable extent. According to my current state of investigation, managing compatibility with a few ifdefs is no longer feasible; instead it seems necessary to maintain different codebases in parallel to be compatible with both QtCreator 3.x and 4.x and cope with the different architectures at the same time. Thus the question arises whether using QtCreator as the basis for the Verilog IDE is an advantage or rather a disadvantage. If you know a better work-around, please send me an email.

All in all it is now clear to me why there are comparatively few plugins for QtCreator in all these years and most of them come directly from the Qt Company. Source and binary compatibility between QtCreator versions is not only complex, but a full-blown nightmare. All the more annoying that many changes to the API seem to be purely cosmetic in nature. Unfortunately, you only realize the size and consequences of this problem when you have developed a sufficiently large plugin yourself and built it for several versions of QtCreator, unless you know the source code of QtCreator very well in several versions, which might only be the case for a few people.

Since I currently consider the effort to reverse engineer each QtCreator version anew and to develop different variants of the code in parallel to be too high, I do it the other way round: instead of adapting the plugin to each major and minor QtCreator version, I offer a simple binary deployment for Linux, Windows and Mac of a lean QtCreator version including VerilogCreator and some other minimal required plugins. See here to learn more: https://github.com/rochus-keller/QtcVerilog.

To do's

  • Documentation
  • Semantic indenter (the current one simply adjusts to the previous line)
  • Parse output of Icarus/Verilator/Yosys and post it to the Issues pane
  • Implement wizzard to add or import files, generate stub modules and automatically update the vlpro file
  • Improve hover text
  • Implement options dialog (format settings, paths, etc.)
  • Improve code completer (for hierarchical identifiers)
  • Integrate wave viewer
  • Implement selected SystemVerilog syntax features as needed

Support

If you need support or would like to post issues or feature requests please use the Github issue list at https://github.com/rochus-keller/VerilogCreator/issues or send an email to the author.