svlint

SystemVerilog linter

Actions Status codecov

Crates.io svlint

svlint

Installation

Download binary

Download from release page, and extract to the directory in PATH.

snapcraft

You can install from snapcraft

sudo snap install svlint

Cargo

You can install by cargo.

cargo install svlint

Usage

Configuration

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] section

[rules] section

By default, all rules are disabled. To enable a rule, assign true to its name, e.g. case_default = true.

Configuration update

If svlint is updated, .svlint.toml can be updated to the latest version with svlint --update.

Rules

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 */

Plugin rules

svlint supports plugin rules, an example of which is available here.

Filelist

svlint supports filelist like major EDA tools. The following features are supported.

An example is below:

xxx.sv ${XXX_DIR}/yyy.sv $(XXX_DIR)/zzz.sv +incdir+$PWD/header/src +define+SYNTHESIS -f other.f

Command Line Interface

``` svlint 0.6.0

USAGE: svlint [OPTIONS] [--] [FILES]...

ARGS: ... Source file

OPTIONS: -1 Print results by single line -c, --config TOML configuration file [default: .svlint.toml] -d, --define Define --dump-filelist Print data from filelists --dump-syntaxtree Print syntax trees -E Print preprocessor output instead of performing checks --example Print TOML configuration example -f, --filelist File list --github-actions Print message for GitHub Actions -h, --help Print help information -i, --include Include directory path --ignore-include Ignore any include -p, --plugin Plugin file -s, --silent Suppress messages --update Update configuration -v, --verbose Print verbose messages -V, --version Print version information ```