SystemVerilog linter
Download from release page, and extract to the directory in PATH.
You can install from snapcraft
sudo snap install svlint
You can install by cargo.
cargo install svlint
First of all, you must put a configuration file .svlint.toml
to specify enabled rules.
Configuration file is searched to the upper directory until /
.
So you can put configuration file (.svlint.toml
) on the repository root
alongside .gitignore
.
Alternatively, for project-wide rules you can set the environment variable
SVLINT_CONFIG
to something like /cad/projectFoo/teamBar.svlint.toml
.
The example of configuration file is below:
```toml [option] excludepaths = ["ip/.*"] prefixlabel = ""
[rules] nonansimodule = true keywordforbiddenwire_reg = true ```
The complete example can be generated by svlint --example
[option]
sectionexclude_paths
is a list of regular expressions.
If a file path is matched with the list, the file is skipped to check.prefix_(inout|input|output)
are strings which port identifiers must begin
with.
Only used when the corresponding rule is enabled.
Defaults to "b_"
, "i_"
, and "o_"
respectively.prefix_label
is a string which generate labels must begin with.
Applicable to if/else
, for
, and case
generate constructs when the
corresponding generate_*_with_label
rule is enabled.
Defaults to "l_"
.
To check only that a label exists, set this to ""
.prefix_instance
is a string which instances must begin with.
Defaults to "u_"
.prefix_(interface|module|package)
are strings which definitions must begin
with.
An alternative naming convention for interface, module, and package names is
uppercase/lowercase first letter.
This is similar to Haskell where types begin with uppercase and variables
begin with lowercase.
These alternative rules are called
(lower|upper)camelcase_(interface|module|package)
.re_(forbidden|required)_*
are regular expressions for detailed naming
conventions, used only when the corresponding rules are enabled.
The defaults for re_required_*
are either uppercase, lowercase, or
mixed-case starting with lowercase, i.e. just vaguely sensible.
The defaults for re_forbidden_*
are to forbid all strings, except those
starting with "X", i.e. not at all sensible (configuration required).[rules]
sectionBy default, all rules are disabled.
To enable a rule, assign true
to its name, e.g. case_default = true
.
If svlint is updated, .svlint.toml
can be updated to the latest version with
svlint --update
.
All rules are documented here. You are welcome to suggest a new rule through Issues or Pull Requests. Some example rulesets, are available here.
If you need to turn off specific rules for a section, then you can use special comments:
systemverilog
/* svlint off keyword_forbidden_always */
always @* foo = bar; // <-- This line is special.
/* svlint on keyword_forbidden_always */
svlint supports plugin rules, an example of which is available here.
svlint supports filelist like major EDA tools. The following features are supported.
+incdir
+define
-f
An example is below:
xxx.sv
${XXX_DIR}/yyy.sv
$(XXX_DIR)/zzz.sv
+incdir+$PWD/header/src
+define+SYNTHESIS
-f other.f
``` svlint 0.6.0
USAGE: svlint [OPTIONS] [--] [FILES]...
ARGS:
OPTIONS:
-1 Print results by single line
-c, --config