Verilog and SystemVerilog support including linting from popular tools, completions, formatting, waveform viewer, and project level analysis.
Install it from the VS Code Marketplace or OpenVSX
slang
(recommended) || iverilog
(Icarus) || verilator
|| modelsim
|| xvlog
(Xilinx/Vivado)The extension will make symlinks to all verilog files in .sv_cache/files, and then pass that to tools with the -y flag so they can discover modules without the need for individual build configs. This can be disabled with verilog.index.enableSymlinks: false
. Note for windows users: "Developer Mode" needs to be turned on in order to reduce the permissions needed to create a symlink, otherwise .sv_cache/files will not get populated.
verible-verilog-format
(recommended) || verilog-format
|| istyle
Verible supports both SystemVerilog and Verilog, while the others are only verilog. verilog.formatDirs
lets you specify directories that you want to format on save, or you can use the global formatOnSave option for verilog/systemverilog.
-->
verible-verilog-ls
|| veridian
|| svls
This is used for definition support, hover support, and most of the analysis features.
Use 6.1 or later for port/param definition support
brew install universal-ctags
This is the recommended linter because it's the fastest and most compliant language frontend, and it has so many more useful warnings than other tools.
// these get passed to linters and other tools with -I, or the correct format for that tool
"verilog.includes": [
"hdl/lib",
"hdl/includes"
],
"verilog.ctags.path": "/usr/local/bin/ctags-universal",
"verilog.lint.slang.enabled": true,
// includes and '-y .sv_cache/files' are already passed to linters
"verilog.lint.slang.args": "--error-limit 200",
"verilog.lint.slang.path": "/usr/local/bin/slang",
// multiple linters can run concurrently
// you can specify if some can only run at the project level
"verilog.lint.verilator.projectEnabled": true,
// tools will use the default name on the path if not given
"verilog.svFormat.formatter": "verible-verilog-format",
"verilog.svFormat.verible.args": "--flagfile=myflags.txt",
"verilog.svFormat.verible.path": "/usr/local/bin/verible-verilog-format",
// select directories to format on save
"verilog.formatDirs": [
"hdl/my/project/with/formatting"
],
For debugging your config, you can see the logs in Output tab > select 'verilog' in the dropdown