Skip to content

Design & Filelist ​

Cross-file features (go to definition, references, inlay hints, workspace symbols, AutoInst, completion) need your source files indexed. Point lazyverilog.toml at a filelist:

toml
[design]
vcode = "demo/vcode.f"
define = ["RTL_SIM"]
SectionOptionTypeDescription
designvcodestringFilelist path, relative to lazyverilog.toml
designdefinestring[]Preprocessor defines for every design file

Filelist format ​

One source file per line, with paths relative to the filelist.

text
rtl/alu.sv
rtl/adder.sv
-f ../my_rtl_list.f
+incdir+rtl/include

# environment variable
${MY_RTL_PATH}/top.sv
+incdir+${MY_RTL_PATH}/include

# UVM library
+incdir+uvm/src
uvm/src/uvm_pkg.sv
LineEffect
rtl.svA source file to index
-f <filelist>Load a nested filelist, its paths relative to itself. -F, -f=<filelist> and -f<filelist> are the same
-v <file>A library file. It is indexed like any source file
+incdir+<dir>Add an include directory. +incdir+<a>+<b> adds several
-y <dir>, -l <file>, -top <name>, -o, -work, ...Ignored, together with their argument
+define+<NAME>Ignored. Put defines in [design].define
othersComments and any other +<option> or -<flag> are ignored

Paths are relative to the filelist that names them, for -f and -F alike. A line ending in \ continues on the next line. Quote a path that contains spaces ("my dir/top.sv" or '...'). // and # start a comment anywhere on the line, even inside quotes.

+incdir+ entries are search paths for `include, not source files.

Environment variables. $MY_RTL_PATH and ${MY_RTL_PATH} are replaced by the variable's value, in filelists and in vcode. The editor must start with the variable set. A variable that is not set is left as written.

UVM library. List the package file and put the headers on an include path. uvm_pkg.sv is indexed, and its `include lines resolve through the include directory, so you do not list every .svh.

No filelist yet ​

Without a lazyverilog.toml, the server indexes the workspace folder or version-control checkout instead. See Without a lazyverilog.toml.

Filelist (vcode)Implicit project
FilesExactly the listed onesEvery .sv and .v under the folder, minus tool output
Include directories+incdir+ entriesEvery directory holding a header, sorted
DefinesdefineNone
Two modules with one nameOnly if you list bothBoth indexed; rename refuses the name
Whole-design compilation[compilation]Off
Shards.cache/lazyverilog in the projectThe user cache, never the tree

Write a filelist once go to definition lands in the wrong copy of a module, or an `ifdef hides code you work on.

Released under the MIT License. Themed with Catppuccin.