wavedrom.el - Wavedrom Integration for Emacs
December 20, 2023 ยท View on GitHub
wavedrom.el - Wavedrom Integration for Emacs
This package provides a major mode for editing and rendering WaveJSON files to create timing diagrams using wavedrom.
Demo
Requirements
-
wavedrom-cli: https://github.com/wavedrom/cli -
Optional:
inkscapeto export to PDF
Installation
MELPA
wavedrom is available on MELPA.
straight.el
To install it via straight with use-package:
(straight-use-package 'use-package)
(use-package wavedrom)
Basic config
The package comes with sensible default values. However, you can
tweak it either with M-x customize-group RET wavedrom RET or with
the following Elisp code:
(setq wavedrom-output-format "pdf")
(setq wavedrom-output-directory "~/wavedrom")
;; Faces suitable for dark themes
(set-face-attribute 'wavedrom-font-lock-brackets-face nil :foreground "goldenrod")
(set-face-attribute 'wavedrom-font-lock-punctuation-face nil :foreground "burlywood")
Usage
-
Create a file with
.wjsonextension andwavedrom-modewill automatically be enabled next time it is opened. -
Fill the file with valid WaveJSON syntax and every time it is saved the function
wavedrom-compilewill be executed, updating the output file and its associated buffer. This provides a WYSIWYG-like result similar to the one with the web editor. -
The output file path will be determined from the value of customizable variables
wavedrom-output-formatandwavedrom-output-directory. For example, if editing the filehello_world.wjson:(setq wavedrom-output-format "svg") (setq wavedrom-output-directory "~/wavedrom")The rendered file will be created at:
~/wavedrom/hello_world.svg
Keybindings
- C-c C-c:
wavedrom-compile - C-c C-p:
wavedrom-preview-browser
Other packages
- verilog-ts-mode: SystemVerilog Tree-sitter mode
- vhdl-ts-mode: VHDL Tree-sitter mode
- verilog-ext: SystemVerilog Extensions
- vhdl-ext: VHDL Extensions
- fpga: FPGA & ASIC Utilities for tools of major vendors and open source
- vunit-mode: Integration of VUnit workflow