Skip to content

Hierarchy

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

Hierarchy extraction is done via Verilog-Perl vhier.

Visualize with outline-minor-mode and outshine.

Installation

  • For Ubuntu/Debian:
sudo apt-get install libverilog-perl

Provided functions and customization:

Extraction

By default verilog-ext-vhier-current-file will look at the list of current Verilog open buffers and their corresponding directories to search for modules. In case there is some missing module or an error related with compilation order, you can customize the variable verilog-ext-vhier-command-file and set a command file that can include a list of the files/includes used for hierarchy extraction, according to vhier syntax. E.g:

(setq verilog-ext-vhier-command-file "~/my-verilog-project/commands.f")

And being the content of commands.f:

-y ~/my-verilog-project/some-not-found-dir
~/my-verilog-project/src/my_pkg.sv
+define+SYNTHESIS+0

After extracting the hierarchy the output will be dumped in directory "vhier" to a file named same as current top module. To customize the output file path you can set the variable verilog-ext-vhier-output-file.

Navigation

Hierarchy navigation is done through the minor-mode verilog-ext-vhier-mode. It is based on outshine-mode and creates the following keybindings:

  • Hide/Show
  • a outline-show-all
  • i outline-show-children
  • h outline-show-children
  • l vhier-hide-sublevels
  • I outline-show-branches
  • ; outline-hide-other
  • Movement
    • u vhier-up-heading
    • C-c C-u vhier-up-heading
    • n vhier-next-visible-heading
    • j vhier-next-visible-heading
    • p vhier-previous-visible-heading
    • k vhier-previous-visible-heading
    • C-c C-n vhier-forward-same-level
    • C-c C-p vhier-backward-same-level
  • Jump
    • o verilog-ext-vhier-outline-jump-to-file
    • RET verilog-ext-vhier-outline-jump-to-file
    • C-j verilog-ext-vhier-outline-jump-to-file

TODO

Current navigation implementation uses outshine since it is a very simple method. There are a couple of alternatives to take into consideration to improve current implementation:

Clone this wiki locally