Skip to content

Formatter CLI

lazyverilog-fmt formats one SystemVerilog file. See CLI tools to build it.

bash
lazyverilog-fmt [-i|--in-place] [--log <log-dir>] <file>
FlagDescription
-i, --in-placeWrite the result back to the file instead of stdout
--log <log-dir>Write per-pass logs to <log-dir>, for debugging
--versionPrint the version

It reads [format] from the nearest lazyverilog.toml above the file, and uses defaults if there is none. See Formatter options.

bash
./build/lazyverilog-fmt rtl/m_alu.sv        # to stdout
./build/lazyverilog-fmt -i rtl/m_alu.sv     # in place

Exit codes

CodeMeaning
0Success
1File not found, or cannot be read or written
2Safety check failed: formatting would have changed more than whitespace

Released under the MIT License. Themed with Catppuccin.