Skip to content
Gonzalo Larumbe edited this page Jun 1, 2023 · 6 revisions

Configuration

First make sure that xref has been included in verilog-ext-feature-list before running verilog-ext-mode-setup.

Then, it is needed to set workspace variables for file parsing and gather project tags through one of these methods:

  • M-x verilog-ext-workspace-get-tags RET
  • M-x verilog-ext-workspace-get-tags-async RET

A tag database will be created and cached for future sessions.

Finally, run xref-find-definitions or xref-find-references on the tag at point.

Pros/cons

Pros:

  • Easy to setup
  • No need for external applications
  • Supports references (at the time of writing no LSP server supported them)

Cons:

  • Slow for large projects with many files
  • Less accurate than other backends

The builtin xref backend uses internal Emacs lisp parser engine to search for definitions and references and might not be completely accurate. For example, definitions of multiple variables in one line are not supported and therefore will not be found. If you need something more reliable consider alternatives from next section.

Alternatives

  • Configuring LSP (see link)
  • Configuring global and ggtags-mode
    • Requires installation of global, ctags (for definitions) and python/pygments (for references).
      # For Ubuntu/Debian systems
      sudo apt-get install global universal-ctags python3-pygments
    • Find complete installation and configuration information here
Clone this wiki locally