2026-02-05 14:53:00 +03:00
2026-02-05 14:53:00 +03:00
2026-02-05 14:53:00 +03:00
2026-02-05 14:53:00 +03:00
2026-02-05 14:53:00 +03:00

verilog-align-ports

Align SystemVerilog ANSI-style port declarations in a contiguous block around point.

Features

  • Aligns direction, type, range, name, and trailing // comments.
  • Works on the contiguous block of port declarations above and below point.
  • Stops at the first non-port line (including blank lines).

Installation

(add-to-list 'load-path "/path/to/verilog-align-ports")
(require 'verilog-align-ports)

Usage

  1. Place point on a line that declares a port (input/output/inout).
  2. Run M-x verilog-align-ports.

Example input:

  input wire rst_i, // rst,
  input wire clk_i, // wr_clk,
  input wire [DataWidth-1:0] d_i, // din,
  output logic full_o,  // full,
  output [DataWidth-1:0]   d_o, // dout,
  output empty_o,// empty,
  output logic valid_o    // data_valid

Example output:

  input  wire                  rst_i,   // rst,
  input  wire                  clk_i,   // wr_clk,
  input  wire  [DataWidth-1:0] d_i,     // din,
  output logic                 full_o,  // full,
  output       [DataWidth-1:0] d_o,     // dout,
  output                       empty_o, // empty,
  output logic                 valid_o  // data_valid

Tests

Run:

./run-tests.sh
Description
Elisp function for alignment SystemVerilog port declarations.
Readme 36 KiB
Languages
Emacs Lisp 98.7%
Shell 1.3%