To keep myself occupied while job searching, I have created the initial
workings of a software tool to rewrite HDL source files according to a set of
user-specified rules. The tool employs the open source ANTLR v3 project to
implement a full VHDL-2008 lexer and parser. (Verilog might also be added.)
The open source ANTLR technology
supports building
token rewritable Abstract Syntax Trees; and I have created IEEE 1076-2008
compliant grammar files that make full use of this feature. The grammars are
complete, unsimplified, and modestly optimized for LL(*) parsing speed.
For the time being I have chosen not to release many details, including
potential use cases, or even what I hope the tool to have as an eventual
product name (trademarked?). However, the
basic functionality of the software is simple: input HDL models, analyze,
rewrite according to a set of high-level user-provided rules, output new valid
and verified HDL models. As of now, the lexer, parser, and XML "project file"
file format are implemented and working, along with automated high-level
regression test cases; and a graphical user interface is under development. My
first milestone of functionality completed is the ability to—what I will term
"hardcode" or "partially-compile"—fully evaluate constant declarations within
a VHDL project, within the VHDL context of package, architecture, or entity,
and then remove the declaration(s) from the sources.
After some extensive research, the most cost-effective route for implementing a proprietary HDL rewriting tool, based on compiler theory (and not just scripting some regular expressions), with lowest-cost technology turned out to be Java. The Java language has a good selection of mature compiler-compilers available for the creation of lexers and parsers. This particular language will also allow the tool to operate on nearly any desktop, and not just the Windows operating system. Since the tool is not intended as a source code editor, but rather a batch operation processor, a custom Swing GUI was decided to be sufficient. Had I intended the tool to be a source code editor I probably would have followed the path of other developers in creating an extension of the Eclipse or Netbeans projects. My modest, yet pragmatic GUI will allow the user to create an XML project file that specifies a list of batch operations and their respective parameters.
| © Copyright Timothy Stotts 2002-2009. All rights reserved. | ^ top of page |