Skip to content

Navigation

Gonzalo Larumbe edited this page Feb 20, 2023 · 14 revisions

Navigate instances inside a module

The following functions are defined for instance navigation:

  • verilog-ext-find-module-instance-fwd
  • verilog-ext-find-module-instance-bwd

However, these are not bound to any key since they are called by verilog-ext-nav-down-dwim (C-M-d) and verilog-ext-nav-up-dwim (C-M-u) respectively, when current file has a module declaration (e.g. RTL code in most cases).

Jump to definition/references of module at point

If point is inside a module instantiation, it is possible to navigate to its definition or references:

  • C-c M-. verilog-ext-jump-to-module-at-point-def
  • C-c M-? verilog-ext-jump-to-module-at-point-ref

This functionality requires setting up a backend for xref and add it to xref-backend-functions. This can be done in two ways:

  • Configuring an LSP (see link)
  • Configuring global and ggtags-mode
    • Requires installation of global, ctags (for definitions) and python/pygments (for references). For Ubuntu/Debian:
      sudo apt-get install global universal-ctags python3-pygments
    • Find further installation information here

Jump to parent module

Jump to parent module via ag/ripgrep. For Ubuntu/Debian:

sudo apt-get install silversearcher-ag ripgrep

For Ubuntu/Debian:

sudo apt-get install global universal-ctags python3-pygments silversearcher-ag ripgrep
  • verilog-ext-jump-to-parent-module

Context aware dwim navigation (do what I mean)

Context aware functions (do what I mean) depending on the file being edited. Modules (RTL) navigate through instances while classes (Verification) navigate through methods/defuns.

  • verilog-ext-nav-beg-of-defun-dwim
  • verilog-ext-nav-end-of-defun-dwim
  • verilog-ext-nav-down-dwim
  • verilog-ext-nav-up-dwim
  • verilog-ext-nav-prev-dwim
  • verilog-ext-nav-next-dwim
Clone this wiki locally