svlint 0.2.1

SystemVerilog linter
svlint-0.2.1 is not a library.
Visit the last successful build: svlint-0.9.2

svlint

SystemVerilog linter

Actions Status Snap 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 like .gitignore.

The example of configuration file is below:

[option]
exclude_paths = ["ip/.*"]

[rules]
non_ansi_module = true
wire_reg = true

The complete example can be generated by svlint --example

[option] section

exclude_paths is a list of regular expression. If a file path is matched with the list, the file is skipped to check.

[rules] section

By default, all rules are disabled. If you want to enable some rules, true can be specified.

Rules

Name Description
enum_with_type enum must have data type
for_with_begin multiline 'for' statement must have 'begin'
function_with_automatic 'function' must be 'automatic'
generate_for_with_label 'generate for' must have label
generate_if_with_label 'generate if' must have label
generate_keyword 'generate'/'endgenerate' must be omitted
genvar_declaration genvar must be declared in loop
if_with_begin multiline 'if' statement must have 'begin'
inout_with_tri 'inout' must have 'tri'
input_with_var 'input' must have 'var'
legacy_always 'always_comb'/'always_ff'/'always_latch' must be used
loop_variable_declaration loop variable must be declared in loop
non_ansi_module module declaration must be ANSI-style
output_with_var 'output' must have 'var'
parameter_in_package 'parameter' must be replaced to 'localparam' in package
priority_keyword 'priority' is forbidden
tab_charactor tab charactor is forbidden
unique0_keyword 'unique0' is forbidden
unique_keyword 'unique' is forbidden
wire_reg 'wire'/'reg' must be replaced to 'logic'/'tri'

Option

svlint 0.1.0

USAGE:
    svlint [FLAGS] [OPTIONS] <files>...

FLAGS:
        --example    Prints config example
    -h, --help       Prints help information
    -s, --silent     Suppresses message
    -1               Prints results by single line
    -V, --version    Prints version information
    -v, --verbose    Prints verbose message

OPTIONS:
    -c, --config <config>          Config file [default: .svlint.toml]
    -d, --define <defines>...      Define
    -f, --filelist <filelist>      File list
    -i, --include <includes>...    Include path

ARGS:
    <files>...    Source file