Skip to content

Code formatter

Gonzalo Larumbe edited this page Sep 14, 2023 · 11 revisions

verilog-ext automatically configures apheleia package to make use of the verible-verilog-format formatter.

Installation

  • Download verible tools: verible-verilog-format
  • Make them available in the $PATH

Shell commands example:

# Download latest release (0.0-2492 at the time of writing)
VERIBLE_GITHUB_URL=https://github.com/chipsalliance/verible
LATEST_RELEASE_URL=releases/download/v0.0-2492-gd122fac8
LATEST_RELEASE_FILE=verible-v0.0-2492-gd122fac8-Ubuntu-22.04-jammy-x86_64.tar.gz
cd ~/Downloads
curl -L -o $LATEST_RELEASE_FILE $VERIBLE_GITHUB_URL/$LATEST_RELEASE_URL/$LATEST_RELEASE_FILE
tar xvzf $LATEST_RELEASE_FILE
cd verible-*/bin
export PATH=$PWD:$PATH

Usage

  • To format current buffer: C-c C-l to run verilog-ext-formatter-run
  • To automatically format buffer after file saving simply enable apheleia-mode: M-x RET apheleia-mode RET
  • To customize the formatter command:
    • M-x customize-group RET verilog-ext-formatter RET
Clone this wiki locally