This is a library to handle parsing of the TOML configuration file used by
The library includes a search algorithm that walks a provided path up to the root directory looking for one of the following files (listed in the order of precedence):
.vl.toml
vl.toml
.vl/.vl.toml
.vl/vl.toml
vl/.vl.toml
vl/vl.toml
In short, the configuration file can have two different names: .vl.toml
or vl.toml
and can reside immediately on the ascended path, or inside a directory named: .vl/
or vl/
.
[verilog]
include_paths = [
"/path/to/some/directory",
"/path/to/another/directory",
"../a/relative/path",
"/a/recursive/include/**"
]
defines = [
"FOO",
"WIDTH=8",
"ONES(x) = {(x){1'b1}}"
]
[vls]
max_nof_diagnostics = 10
cache_workspace_on_open = true
indent_size = 4
tabs_to_spaces = true
space_in_named_connection = false
[diagnostics]
undeclared_identifiers = true
unconnected_ports = true
missing_ports = true
missing_parameters = false
unassigned_parameters = true
- The
verilog
table collects language-specific settings. - The
vls
table collects settings specific to the language server. - The
diagnostics
table collects settings specific to diagnostic messages.
-
include_paths
is an array of strings expressing the include paths wherevls
should look for externally defined modules and files targeted by`include
directives. By default, only the Verilog files immediately on the path are included, i.e./path/to/some/directory/*.v
, However, a recursive include may be specified by ending the path with/**
, i.e./path/to/some/directory/**
. -
defines
is an array of strings expressing the defines that should be passed tovls
. The rules follow that of the-D
option forvparse
. It's possible to specify a macro by using the character=
to separate the macro name from its body.
-
max_nof_diagnostics
specifies the maximum number of diagnostic messages passed in atextDocument/publishDiagnostics
notification. The default value is-1
and implies no upper bound. -
cache_workspace_on_open
specifies whether or not to attempt to cache all the modules present on the include paths (verilog.include_paths
) when a new file is opened. The default value istrue
. If the value is set tofalse
, then the degree to which the workspace is 'explored' depends on the module hierarchy seen from the opened file.For example, if an instantiation of module
A
is encountered and its declaration is unknown, the source files on the include paths will be analyzed until the declaration is found or the set of source files is exhausted. If the declaration of moduleB
is also present on the include path, but not instantiated by any module, its declaration will remain unknown, unless it was discovered when searching for moduleA
.Not exploring the full workspace affects module instantiation completions but comes with a positive impact on parsing speed for very large workspaces.
-
indent_size
specifies how many spaces to use for one level of indentation. The default value is4
. -
tabs_to_spaces
specifies whether or not to insert spaces instead of the tab character\t
for indentation. The default value istrue
. -
space_in_named_connection
specifies whether or not to insert a space when completing a named connection, i.e..clk_i()
vs..clk_i ()
. The default value isfalse
.
-
undeclared_identifiers
specifies whether or not to publish diagnostic messages for undeclared identifiers. The default value istrue
. -
unconnected_ports
specifies whether or not to publish diagnostic messages if a module instance has unconnected input ports. The default value istrue
. -
missing_ports
specifies whether or not to publish diagnostic messages if a module instance doesn't list all the available ports. The default value istrue
. -
missing_parameters
specifies whether or not to publish diagnostic messages if a module instantiation doesn't list all the available parameters. The default value isfalse
since relying on default parameter values can be a intentional design strategy. -
unassigned_parameters
specifies whether or not to publish diagnostic messages if a module instantiation has unassigned named parameter connections, e.g..WIDTH()
. The default value istrue
.
Releases follow semantic versioning to determine how the version number is incremented. If the specification is ever broken by a release, this will be documented in the changelog.
If you discover a bug or what you believe is unintended behavior, please submit an issue on the issue board. A minimal working example and a short description of the context is appreciated and goes a long way towards being able to fix the problem quickly.
This tool is free software released under the MIT license.
vltoml
is maintained by Marcus Eriksson.