Home

Awesome

SVLangserver

A language server for systemverilog that has been tested to work with coc.nvim, VSCode, Sublime Text 4, emacs, and Neovim

Features

Versions

The code has been tested to work with below tool versions

Installation

To get the snippets, git clone this repo and copy the snippets directory wherever applicable

For installing from source (not applicable for VSCode)

NOTE: This has been tested with npm version 6.14.13 and node version 14.17.1

Settings

Commands

coc.nvim usage

command! SvBuildIndex call CocRequest("svlangserver", 'workspace/executeCommand', {'command': 'systemverilog.build_index'})
command! -range SvReportHierarchy call CocRequest("svlangserver", 'workspace/executeCommand', {'command': 'systemverilog.report_hierarchy', 'arguments': [input('Module/interface: ', <range> == 0 ? "" : expand("<cword>"))]})

If the above SvReportHierarchy command is called with visual selection, then the module name is pre-filled with the selection. Also depending on the coc.nvim version, the generated rpt.json file might not have the focus and user will have to switch buffer manually.

VSCode usage

Sublime usage

[
  {
    "caption": "SvLangserver Build Index",
    "command": "lsp_execute",
    "args": {
      "session_name": "svlangserver",
      "command_name": "systemverilog.build_index",
      "command_args": []
    }
  },
  {
    "caption": "Svlangserver Report Hierarchy",
    "command": "lsp_execute",
    "args": {
      "session_name": "svlangserver",
      "command_name": "systemverilog.report_hierarchy",
      "command_args": ["${selection}"]
    }
  }
]

This should make the commands available in the command palette. For the report hierarchy command, the module name should be selected before invoking the command.

Emacs usage

Previous commands can be run with eglot and verilog-ext:

Neovim usage

Troubleshooting

Known Issues

Future

Rewrite parser to make it much more robust

Acknowledgements

Although most of the code is written from scratch, this VSCode-SystemVerilog extension was what I started with and developed on.

Release Notes

See the changelog for more details

0.4.1

0.4.0

0.3.5

0.3.4

0.3.3

0.3.1

0.3.0