-
-
Notifications
You must be signed in to change notification settings - Fork 7
Code formatter
Gonzalo Larumbe edited this page Feb 19, 2023
·
11 revisions
verilog-ext
automatically configures apheleia package to make use the verible-verilog-format
formatter.
- Download verible tools:
verible-verilog-format
- Make them available to 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
- To format current buffer: C-c C-l to run
verilog-ext-code-format
- To automatically format buffer after file saving just enable
apheleia-mode
:M-x RET apheleia-mode RET
- To customize the formatter command:
M-x customize-group RET verilog-ext RET
- Check formatter variables:
verilog-ext-formatter-column-limit
,verilog-ext-formatter-indentation-spaces
,verilog-ext-formatter-line-break-penalty
, etc...