Skip to content
Gonzalo Larumbe edited this page Dec 19, 2023 · 4 revisions

Configuration

This feature is only available with Tree-sitter and vhdl-ts-mode. See this link for setup.

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

Set the variable vhdl-ext-project-alist:

(setq vhdl-ext-project-alist
      ("axi_if_converter"
       :root "/home/gonz/Repos/larumbe/axi_if_converter"
       :files ("src/top/rtl/global_pkg.vhd"
               "src/misc/clk_div.vhd"
               "src/misc/clk_sync.vhd"
               "src/pattern_counter/rtl/pattern_counter.vhd"
               "src/input_buffer/rtl/input_buffer_pkg.vhd"
               "src/input_buffer/rtl/input_buffer.vhd"
               "src/core_fsm/rtl/core_fsm.vhd"
               "src/axi_lite_regs/rtl/axi_lite_regs.vhd"
               "src/axi_lite_master/rtl/axi_lite_master.vhd"
               "src/core_conv/rtl/core_converter.vhd"
               "src/top/rtl/axi_if_converter.vhd")
       ;; The ones below are used for GHDL-related features
       :worklib "xil_defaultlib"                    ; Defaults to `work' if not set
       :workdir "library/xil_defaultlib"            ; Output compilation directory for worklib
       :lib-search-path ("/opt/ghdl_Xilinx_lib/"))) ; Extra directories to look for compiled libraries

Next visit one of the project files and gather tags through one of these commands:

  • M-x vhdl-ext-tags-get RET
  • M-x vhdl-ext-tags-get-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 (only tree-sitter)

Cons:

  • Might be less accurate than LSP or ggtags

If you need something readily available and 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