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.
Design units and declarations
Section titled “Design units and declarations”- Modules, interfaces, packages, classes, generate regions, and nested classes.
- ANSI and non-ANSI ports, parameter ports, header imports,
timeunit,genvar, anddefparam. - Net and variable declarations, signing, packed and unpacked dimensions, and net delays.
typedefaliases, 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.
Procedural and concurrent code
Section titled “Procedural and concurrent code”assign,always,always_comb,always_ff,always_latch,initial, andfinal.- Blocks, conditionals, every
casekind, 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.
Instantiation and elaboration
Section titled “Instantiation and elaboration”- Module and gate instantiation, named and ordered connections,
.*, parameter overrides, instance arrays, and drive strengths. binddirectives at file, module, and generate scope.- Module-level generate
if,for, andcase, including elaboration system tasks. - Compiler directives and macros between list elements, including conditional branches inside ports, parameters, enums, overrides, and connections.
Expressions
Section titled “Expressions”- 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 supportednewforms. - Dynamic arrays, queues, associative arrays, empty literals, and
$-bound indexing. - Macro invocations in expression, statement, and item position; macro digits in based numbers.
Preserved rather than reformatted
Section titled “Preserved rather than reformatted”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.
Not supported
Section titled “Not supported”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.