A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gmlarumbe/verilog-ext below:

gmlarumbe/verilog-ext: Verilog Extensions for Emacs

verilog-ext.el - SystemVerilog Extensions for Emacs

This package provides useful extensions on top of verilog-mode and verilog-ts-mode.

Tree-sitter is optional but recommended and only required if using verilog-ts-mode for some of the features above.

For more info, see the wiki.

verilog-ext is available on MELPA.

To install it via straight with use-package:

(straight-use-package 'use-package)
(use-package verilog-ext)

The most basic configuration just requires choosing which features you want to load, setup the minor-mode and add it as a hook for verilog-mode. By default all features are enabled:

;; Can also be set through `M-x RET customize-group RET verilog-ext':
;; Comment out/remove the ones you do not need
(setq verilog-ext-feature-list
      '(font-lock
        xref
        capf
        hierarchy
        eglot
        lsp
        lsp-bridge
        lspce
        flycheck
        beautify
        navigation
        template
        formatter
        compilation
        imenu
        which-func
        hideshow
        typedefs
        time-stamp
        block-end-comments
        ports))
(require 'verilog-ext)
(verilog-ext-mode-setup)
(add-hook 'verilog-mode-hook #'verilog-ext-mode)

If installed and loaded via use-package:

(use-package verilog-ext
  :hook ((verilog-mode . verilog-ext-mode))
  :init
  ;; Can also be set through `M-x RET customize-group RET verilog-ext':
  ;; Comment out/remove the ones you do not need
  (setq verilog-ext-feature-list
        '(font-lock
          xref
          capf
          hierarchy
          eglot
          lsp
          lsp-bridge
          lspce
          flycheck
          beautify
          navigation
          template
          formatter
          compilation
          imenu
          which-func
          hideshow
          typedefs
          time-stamp
          block-end-comments
          ports))
  :config
  (verilog-ext-mode-setup))

Enabling of verilog-ext-mode minor-mode creates the following keybindings:

Some of the features that verilog-ext provides are based either on builtin verilog-mode Emacs lisp parsing or on tree-sitter verilog-ts-mode. These features are hierarchy extraction and project tags collection for completion and navigation of definitions and references.

Using tree-sitter as a backend is recommended as it is much faster, efficient and accurate than internal Emacs lisp parsing.

For information about installation of verilog-ts-mode check its repo.

The package provides the variable verilog-ext-project-alist to select which files belong to a specific project:

(setq verilog-ext-project-alist
      `(("ucontroller" ; Project name
         :root "/home/gonz/Repos/larumbe/ucontroller" ; supports remote dirs via Tramp
         :files ("src/my_block.sv"
                 "src/*.v") ; Multiple files can be specified through the glob pattern
         :dirs ("src/tb"
                "-r src/rtl" ; -r to add directories recursively
                "src/syn/*_block"
                "src/**/netlists") ; add all dirs that begin with "src" and end with "netlists"
         :ignore-dirs ("src/ignored_ip")
         :ignore-files ("src/some_ip/ignored_sim_netlist.v")
         :compile-cmd "make tb_top" ; command used to compile current project
         ;; `vhier' related properties
         :command-file "commands.f" ; vhier command file
         :lib-search-path nil)))    ; list of dirs to look for include directories or libraries

The different properties for each project entry determine which files will be used for some features of the package, such as completion, xref navigation, hierarchy extraction and compilation.

For configuration information, see the wiki.

Find definitions and references

verilog-ext provides an xref backend to navigate definitions and references of current project.

For configuration information, see the wiki.

Complete with tags from current project. Supports dot and scope completion for module signals, class attributes and methods.

For configuration information, see the wiki.

Hierarchy extraction of module at current buffer.

For configuration information, see the wiki.

Auto-configure various SystemVerilog language servers for lsp-bridge, lsp-mode, eglot and lspce:

For configuration instructions, see the wiki

Support via flycheck for the following linters:

For configuration and usage instructions, see the wiki

Indent blocks and align parameters and ports of RTL instances.

Interactive functions:

Batch-mode functions:

Features:

For detailed info see the wiki.

Select among snippets that cover most frequently used SystemVerilog constructs:

Insert instances in current module from file:

Create basic testbench environment from DUT file:

UVM Agent template:

Functions:

Code-formatter setup via apheleia and verible-verilog-format.

See configuration in the wiki.

Provides functions to perform compilations with syntax highlighting and jump to error, buffer preprocessing and makefile development:

See configuration in the wiki.

Support detection of instances and methods inside classes.

Instances:

Methods:

Find more information here.

Enhanced which-func support: show current block/instance at point in the mode-line

Code folding via hideshow: C-<tab>

Add support for syntax-higlighting and alignment via verilog-pretty-declarations of user defined types and classes.

For configuration see wiki

Automatic update of header timestamp after file saving.

For configuration see wiki

Auto convert block comments to names after file saving.

Toggle connections of ports under instance at point

Wrapper functions to stop cursor at underscores without breaking indentation

Contributions are welcome! Just stick to common Elisp conventions and run the ERT suite after testing your changes and before submitting a new PR.

For new functionality add new ERT tests if possible.

Consider sponsoring to help maintaining the project and for the development of new features. Thank you!

To run the whole ERT test suite change directory to the verilog-ext root and make sure test-hdl Git submodule has been loaded:

git submodule update --init

Then run the default target:

To run a subset of tests (e.g. navigation):

To regenerate all the expected outputs for the tests:

To regenerate the expected outputs for a group of tests (e.g. navigation):

$ make gen TESTS=navigation

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4