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.1% of files parse; the remaining failures are concentrated in deliberately unsupported categories and non-standalone inputs.

  • Modules, interfaces, packages, 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, and net delays.
  • 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, and properties. Concurrent property bodies are preserved verbatim.
  • randomize() with, randcase, let, statement labels, array iterator methods, and omitted positional arguments.
  • Constraint blocks, covergroups, and randomization constraint bodies are preserved verbatim.
  • Module and gate instantiation, named and ordered connections, .*, parameter overrides, instance arrays, and drive strengths.
  • bind directives at file, module, and generate scope.
  • 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.
  • Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations, casts, 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, constraints, covergroups, concurrent property/sequence bodies, and carefully recovered conditional-split declarations. This keeps unfamiliar subgrammars safe without blocking the surrounding file.

specify blocks, checker, program, interface class, and randsequence remain outside the formatter grammar. 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.