A parser for a subset of Verilog and SystemVerilog.
Our parser is responsible for processing a list of tokens into our
internal representation of Verilog syntax. Typically these tokens are
produced by the lexer. Note that before parsing begins, any whitespace
or comment tokens should be removed from the token list; see for instance vl-kill-whitespace-and-comments.
We use essentially a manual recursive-descent style parser. Having the
entire token stream available gives us arbitrary lookahead, and we occasionally
make use of backtracking.
Verilog and SystemVerilog are huge languages, and we can parse only a subset
of these languages.
We can currently support most of the constructs in the Verilog 1364-2005
standard. Notably, we do not yet support user-defined primitives, generate
statements, specify blocks, specparams, and genvars. In some cases, the parser
will just skip over unrecognized constructs (adding warnings when it
does so.) Depending on what you are doing, this behavior may be actually
appropriate, e.g., skipping specify blocks may be okay if you aren't trying to
deal with low-level timing issues.
We are beginning to work toward supporting SystemVerilog based on the
1800-2012 standard. But this is preliminary work and you should not yet expect
VL to correctly handle any interesting fragment of SystemVerilog.
- Parser for Verilog and SystemVerilog expressions.
- Functions for parsing User Defined Primitives (UDPs).
- Functions for parsing Verilog and SystemVerilog procedural statements.
- Functions for parsing SystemVerilog assertion sequence and property
- Parser for elements contained within modules, interfaces, etc., including
- Functions for parsing parameter declarations.
- Functions for parsing Verilog and SystemVerilog block items.
- Supporting functions for the parser.
- Functions for parsing module instances.
- Functions for parsing Verilog-2005 and SystemVerilog function and
- Functions for parsing lvalue expressions and assignments.
- Functions for parsing SystemVerilog clocking blocks.
- Functions for parsing drive/charge strengths.
- Match genvar_declaration.
- Top level parsing function.
- Functions for parsing net declarations.
- Functions for parsing SystemVerilog assertions.
- Match an optional lifetime for SystemVerilog-2012.
- Functions for parsing DPI import/export statements.
- Functions for parsing Verilog and SystemVerilog ports.
- Functions for parsing SystemVerilog timeunit and
- A variant of ACL2::seq for use in VL's parser.
- Functions for parsing SystemVerilog packages.
- Functions for parsing event controls.