Awesome
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
<img src="https://github.com/gmlarumbe/wavedrom-mode/assets/51021955/f2750631-eb69-4fa2-a11b-c127092776c6" width=100%>Requirements
-
wavedrom-cli
: https://github.com/wavedrom/cli -
Optional:
inkscape
to 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
.wjson
extension andwavedrom-mode
will automatically be enabled next time it is opened. -
Fill the file with valid WaveJSON syntax and every time it is saved the function
wavedrom-compile
will 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-format
andwavedrom-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
- <kbd>C-c C-c</kbd>:
wavedrom-compile
- <kbd>C-c C-p</kbd>:
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