项目作者: vivekmalneedi

项目描述 :
A SystemVerilog Language Server
高级语言: Rust
项目地址: git://github.com/vivekmalneedi/veridian.git
创建时间: 2020-07-23T02:29:19Z
项目社区:https://github.com/vivekmalneedi/veridian

开源协议:MIT License

下载


veridian

build
GitHub

A SystemVerilog Language Server\

Installation

Pre-Installation

  • It is recommended to install the verible tools for
    • formatting support with verible-verilog-format
    • syntax checking support with verible-verilog-syntax
  • It is recommended to install verilator for additional linting

Install from Release

  • Download the latest release for your OS from the releases page
    • The nightly release contains the last successful build, and is not guaranteed to be stable
    • The ubuntu build also includes slang for linting

Install from Source

  • Build dependencies: Rust toolchain (Install through system package manager or through rustup)
  • optional: C++17 compatible compiler (for linting with slang)
  1. # install with slang feature, if C++17 compiler is available
  2. cargo install --git https://github.com/vivekmalneedi/veridian.git --all-features
  3. # install if C++17 compiler is not available
  4. cargo install --git https://github.com/vivekmalneedi/veridian.git

Usage

neovim

  1. local lspconfutil = require 'lspconfig/util'
  2. local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git")
  3. require('lspconfig').veridian.setup {
  4. cmd = { 'veridian' },
  5. root_dir = function(fname)
  6. local filename = lspconfutil.path.is_absolute(fname) and fname
  7. or lspconfutil.path.join(vim.loop.cwd(), fname)
  8. return root_pattern(filename) or lspconfutil.path.dirname(filename)
  9. end;
  10. }
  11. `

vscode

  • download veridian.vsix from the latest release
  • install the extension using one of the two following methods
    • In the extensions tab, click on the 3 dots, then click Install from VSIX and choose veridian.vsix
    • Run code --install-extension veridian.vsix

coc.nvim

In coc-settings.json:

  1. {
  2. "languageserver": {
  3. "veridian": {
  4. "command": "veridian",
  5. "filetypes": ["systemverilog", "verilog"]
  6. }
  7. }

Emacs

  • Install the verilog-ext package
  • Copy the following snippet into your init file:
  1. (require 'verilog-ext)
  2. (verilog-ext-mode-setup)
  3. (verilog-ext-eglot-set-server 've-veridian) ;`eglot' config
  4. (verilog-ext-lsp-set-server 've-veridian) ; `lsp' config

The full list is on the wiki

Configuration

  • Specify source directories and include directories using a yaml project config
  • All settings have defaults so your config file should only specify custom values

In veridian.yml:

  1. # list of directories with header files
  2. include_dirs:
  3. - inc1
  4. - inc2
  5. # list of directories to recursively search for SystemVerilog/Verilog sources
  6. source_dirs:
  7. - src
  8. - src2
  9. # if true, recursively search the working directory for files to run diagnostics on
  10. # default: true
  11. auto_search_workdir: true|false,
  12. # verible tool configuration
  13. verible:
  14. # verible-verilog-syntax configuration
  15. syntax:
  16. # default: true if in path
  17. enabled: true|false,
  18. path: "verible-verilog-syntax"
  19. # default: none
  20. args:
  21. - arg1
  22. - arg2
  23. # verible-verilog-format configuration
  24. format:
  25. # default: true if in path
  26. enabled: true|false,
  27. path: "verible-verilog-format"
  28. # default: none
  29. args:
  30. - arg1
  31. - arg2
  32. verilator:
  33. # verilator configuration
  34. syntax:
  35. # default: true if in path
  36. enabled: true|false,
  37. path: "verilator"
  38. # default: specified below
  39. args:
  40. - --lint-only
  41. - --sv
  42. - -Wall
  43. # set log level
  44. # default: Info
  45. log_level: Error|Warn|Info|Debug|Trace

LSP Support

See the LSP Specification for more details

  • diagnostics (using slang or verible)
  • completion
    • identifier completion
    • dot completion
    • keywords & snippets
    • system task/function and compiler directives
  • hover (documentation)
  • definition
  • documentSymbol
  • documentHighlight
  • formatting (using verible)
  • rangeFormatting (using verible)

Alternatives

The Verible project is working on a language server for SystemVerilog, check it out here