Skip to content

Supported syntax

lucisv targets Verilog-2001 and the common synthesizable SystemVerilog subset, plus the design-verification constructs most often encountered in real repositories. On the measured 820-file corpus, 99.3% of files parse; the remaining failures require cross-file macro expansion, hit a conditional-split outlier, or are not valid standalone inputs.

  • Modules, interfaces, programs, packages, classes, interface classes, generate regions, and nested classes.
  • ANSI and non-ANSI ports, parameter ports, header imports, timeunit, genvar, and defparam.
  • Net and variable declarations, signing, packed and unpacked dimensions, net delays, and net drive strengths.
  • typedef aliases, enums, packed structs/unions, forward class declarations, anonymous aggregate types, and type parameters.
  • Virtual interfaces, parameterized class types, properties, methods, constructors, prototypes, and out-of-body method definitions.
  • Functions and tasks in ANSI and legacy forms, DPI imports/exports, and package re-exports.
  • assign, always, always_comb, always_ff, always_latch, initial, and final.
  • Blocks, conditionals, every case kind, loops, foreach, fork/join*, waits, timing controls, events, force/release, and jump statements.
  • Immediate and concurrent assertions, sequences, properties, expect, cover sequence, and default disable iff. Property and sequence expressions use their LRM precedence and participate in formatting and semantic tools.
  • randomize() with, randcase, real randsequence productions, statement-level let, statement labels, array iterator methods, and omitted positional arguments.
  • Nonblocking ->> event triggers with optional timing and min:typ:max clocking skews.
  • Constraint blocks and randomization constraint bodies, including soft, dist, implication, foreach, and solve before.
  • Covergroups with coverpoints, bins, transitions, crosses, with, and iff expressions.
  • Module and gate instantiation, named and ordered connections, .*, parameter overrides, instance arrays, and drive strengths.
  • bind directives at file, module, and generate scope, including indexed hierarchical targets and target-scope connection resolution.
  • Module-level generate if, for, and case, including elaboration system tasks.
  • Compiler directives and macros between list elements, including conditional branches inside ports, parameters, enums, overrides, and connections.
  • Vendored/formal collateral: specify/specparam, UDP primitive/table, checker, config, library map entries, alias, and union tagged. Block interiors that do not feed language tools are preserved as opaque source.
  • Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations with with [range], constant-expression and packed-type cast bases, and assignment patterns.
  • Hierarchical and package-scoped names, named call arguments, array methods, inside, and all supported new forms.
  • Dynamic arrays, queues, associative arrays, empty literals, and $-bound indexing.
  • Macro invocations in expression, statement, and item position; macro digits in based numbers.

Some constructs are recognized structurally but emitted with their internal source layout intact: compiler directives, macro bodies, specify, UDP, checker and config blocks, and carefully recovered conditional-split declarations. Constraint, covergroup and SVA parsers also keep a byte-exact fallback for an unfamiliar body, so unsupported subgrammar does not block the surrounding file.

Parser acceptance does not imply full elaboration or semantic navigation: generate-block-scoped hierarchical paths and DPI-export name binding remain gaps. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input.