VS Code 对 Verilog/SystemVerilog 的支持
HDL support for VS Code with syntax highlighting, snippets, classic Ctags-backed editing features, linting, formatting, waveform viewing, inactive preprocessor highlighting, and optional external language servers. Ask DeepWiki
Install the extension from the VS Code Marketplace or Open VSX Registry.
xvlog, Slang, or Verible Verilog Lint.verilog-format, iStyle, or verible-verilog-format.The extension does not scan or index an HDL workspace automatically. Cross-file project intelligence is available only through an external language server or another dedicated extension.
The built-in editing providers use Universal Ctags, which supports SystemVerilog better than older Ctags implementations.
Configure Ctags with:
{
"verilog.ctags.enabled": true,
"verilog.ctags.path": "ctags"
}The built-in Ctags integration generates tags in memory for the currently opened file. It does not create a workspace-wide tag database or automatically index other HDL files. An independent extension such as Ctags Companion can provide broader workspace or external-library lookup.
Universal Ctags installation options:
Set verilog.linting.linter to one of:
iverilogmodelsimverilatorxvlogslangverible-verilog-lintnoneThe selected executable must be on PATH, or its installation directory can be set with verilog.linting.path. Automatic linting uses the classic behavior: configured linters run when Verilog/SystemVerilog documents are opened and saved. The command Verilog: Rerun lint tool runs it manually.
Include directories configured through each linter's includePath setting can be absolute or workspace-relative. Custom arguments are split into an argument array and are not executed as a shell command.
Vivado xvlog may create xsim.dir, xvlog.pb, and related compiler files in its current working directory. Each lint run now uses its own extension-managed temporary directory as the process working directory. The source file, configured include directories, and relative -f/project-file arguments are resolved before the process starts. The directory is removed after success, failure, or cancellation.
The extension does not inject a -work option. In particular, it does not use the invalid -work work= form that prevented diagnostics on some Windows/Vivado versions. Custom xvlog arguments remain supported.
On Windows, the shared tool runner resolves xvlog.exe, xvlog.cmd, or xvlog.bat and passes arguments without building an unsafe shell command string.
Use VS Code's Format Document command after choosing a formatter under verilog.formatting.
verilog-format, iStyle, or verible-verilog-formatverible-verilog-formatRange formatting is not supported. Formatter paths and arguments are configured separately. The verilog-format settings path supports ~ and ${env:VAR} expansion.
Set verilog.waveform.viewer to:
auto — use Vaporview when installed, otherwise FliplotvaporviewfliplotUse Verilog: Open Waveform for the configured behavior or Verilog: Open Fliplot Waveform Viewer to open the bundled viewer directly.
The lightweight editor scanner highlights inactive branches controlled by `ifdef, `ifndef, `elsif, `else, and `endif.
{
"verilog.preprocessor.defines": ["SIMULATION", "USE_VENDOR_IP"],
"verilog.preprocessor.inactiveCode.enabled": true,
"verilog.preprocessor.inactiveCode.opacity": 0.45
}This scanner uses macros defined in the current document plus verilog.preprocessor.defines. It does not resolve include files, filelists, or simulator arguments.
External language servers are disabled by default and configured under verilog.languageServer. Multiple servers can be enabled, although overlapping providers may produce duplicate results.
| Language server | Verilog | SystemVerilog | VHDL / Tcl-family |
|---|---|---|---|
| svls | — | yes | — |
| veridian | — | yes | — |
| HDL Checker | yes | yes | VHDL |
| verible-verilog-ls | yes | yes | — |
| vhdl_ls | — | — | VHDL |
| tclsp | — | — | Tcl, SDC, XDC, UPF |
Use Verilog: Doctor to check enabled server executables, arguments, and configuration paths.
Stable v1.29 returns to the classic v1.25 architecture. The extension-owned project model, semantic index, hierarchy, project diagnostics, compile-unit linting, HDL Explorer, and managed slang-server runtime are no longer part of the stable extension.
Existing .slang/server.json files are not read, created, modified, or deleted. Obsolete settings may remain in user or workspace settings, but the extension no longer consumes them. Review VS Code settings and remove keys under the former project, semantic-diagnostics, hierarchy, HDL Explorer, and managed slang-server namespaces when convenient.
Ctags-backed editing features and the optional external language-server integrations are available again.
Verilog Doctor output channel.PATH, or configure its path explicitly.PATH.See CONTRIBUTING.md for development instructions and THIRD_PARTY_NOTICES.md for bundled third-party notices.
暂无开放 Issues,或尚未同步最近议题。