Skip to content

emacsmirror/vhdl-ext

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status MELPA Build Status License: GPL v3

vhdl-ext.el - VHDL Extensions for Emacs

This package includes some extensions on top of the great Emacs vhdl-mode.

  • Tree-sitter powered vhdl-ts-mode
  • Improve syntax highlighting
  • LSP configuration for lsp-mode and eglot
  • Additional options for flycheck linters
  • Improve imenu, detect instances
  • Navigate through instances in a entity
  • Jump to definition/reference of entity at point
  • Templates insertion via hydra

Installation

MELPA

vhdl-ext is available on MELPA.

See Getting Started for instructions on how to setup and download packages.

vhdl-ts-mode is not yet available on MELPA. See notes for more info.

straight.el

To install it via straight with use-package:

(straight-use-package 'use-package)

(use-package vhdl-ext
  :straight (:host github :repo "gmlarumbe/vhdl-ext"
             :files ("vhdl-ext.el" "vhdl-ts-mode.el"")))

Manually

First download vhdl-ext in the desired directory (e.g. ~/.emacs.d):

$ cd ~/.emacs.d
$ git clone https://github.com/gmlarumbe/vhdl-ext

And add the following snippet to your .emacs or init.el:

(add-to-list 'load-path (expand-file-name "~/.emacs.d/vhdl-ext"))
(require 'vhdl-ext)

Basic config

The most basic configuration just requires setup of the minor-mode and to add it as a hook for vhdl-mode:

(vhdl-ext-mode-setup)
(add-hook 'vhdl-mode-hook #'vhdl-ext-mode)

If installed and loaded via use-package:

(use-package vhdl-ext
  :after vhdl-mode
  :demand
  :hook ((vhdl-mode . vhdl-ext-mode))
  :config
  (vhdl-ext-mode-setup))

Keybindings

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

  • C-M-u vhdl-ext-find-entity-instance-bwd
  • C-M-d vhdl-ext-find-entity-instance-fwd
  • C-M-. vhdl-ext-jump-to-parent-entity
  • C-c M-. vhdl-ext-jump-to-entity-at-point-def
  • C-c M-? vhdl-ext-jump-to-entity-at-point-ref
  • C-c C-t vhdl-ext-hydra/body

Features

Tree-sitter

The package provides the major-mode vhdl-ts-mode for syntax highligting and indentation. It is derived from vhdl-mode making all vhdl-mode functionality still available.

vhdl-ts-mode is still work in progress and aims to provide the same functionality as vhdl-ext but much faster and efficiently.

For more information see the wiki.

Syntax highlighting

For face customization: M-x customize-group RET vhdl-ext-faces

Language Server Protocol

Auto-configure various VHDL language servers for lsp-mode and eglot:

For configuration instructions, see the wiki.

Linting

Enhanced version of GHDL flycheck checker.

  • Allows setting name of current work library name, e.g:
    (setq vhdl-ext-flycheck-ghdl-work-lib (vhdl-work-library))
  • Automatically include directories of open VHDL buffers
    • Variable vhdl-ext-flycheck-ghdl-include-path will be updated every time a new VHDL file is opened

Imenu

Support detection of instances

Navigation

  • Navigate instances inside an entity
  • Jump to definition/references of entity at point
  • Jump to parent entity

For detailed info see the wiki.

Snippets

Snippet selection via hydra.

  • vhdl-ext-hydra/body: C-c C-t

Contributing

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.

ERT Tests setup

To run the whole ERT test suite change directory to the vhdl-ext root and run the test target:

$ cd ~/.emacs.d/vhdl-ext
$ make test

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

$ cd ~/.emacs.d/vhdl-ext
$ tests/scripts/ert-tests.sh recompile_run imenu::

Other packages

  • verilog-ext: SystemVerilog Extensions for Emacs
    • Analog package to edit Verilog/SystemVerilog sources

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 50.2%
  • VHDL 47.4%
  • Shell 2.1%
  • Makefile 0.3%