It is strongly recommended to create a new VSCode profile for Verilog development to keep your settings and extensions organized.
- Open VSCode.
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
on macOS). - Type
Profiles: Create Profile
and select it. - Enter a name for your new profile, e.g.,
Verilog Development
. - Click
Create
.
Alternatively, you can use the GUI:
- Click on the
Manage
icon in the bottom left corner. - Hover over
Profiles
. - Select
Profiles
>Create Profile
. - Enter a name for your new profile, e.g.,
Verilog Development
. - Click
Create
. - Set other options as needed.
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
on macOS). - Type
Preferences: Open Settings (UI)
and select it. - Make sure you are in the correct profile by checking the profile name in the bottom left corner.
- Adjust your settings as needed for Verilog development.
- Verilog-HDL/SystemVerilog/Bluespec: For snippet, syntax hightlight and formatter
- Verible: For linter
To use the recommended extensions and settings, you need to install verible
. Follow these steps to install it:
-
Using Homebrew (macOS):
brew tap chipsalliance/verible brew install verible
-
Using Pre-built Binaries: Download the latest release from the Verible GitHub Releases page and follow the installation instructions for your platform.
-
Building from Source: Follow the instructions on the Verible GitHub repository to build and install from source.
Make sure verible-verilog-ls
is in your system's PATH so that VSCode can use it.
To ensure a smooth Verilog development experience, add the following settings to your VSCode configuration:
{
"[verilog]": {
"editor.defaultFormatter": "mshr-h.veriloghdl"
},
"verilog.formatting.verilogHDL.formatter": "verible-verilog-format",
"verilog.formatting.veribleVerilogFormatter.arguments": "--indentation_spaces=4 --case_items_alignment=align --assignment_statement_alignment=align --class_member_variable_alignment=align --distribution_items_alignment=align --enum_assignment_statement_alignment=align --formal_parameters_alignment=align --module_net_variable_alignment=align --named_parameter_alignment=align --named_port_alignment=align --port_declarations_alignment=align --struct_union_members_alignment=align",
"verible.arguments": [
"--rules=-always-comb,-unpacked-dimensions-range-ordering,-explicit-parameter-storage-type",
"--file_list_path=${workspaceFolder}/verible.filelist",
"--indentation_spaces=4"
],
"verible.path": "verible-verilog-ls",
}
"[verilog]": { "editor.defaultFormatter": "mshr-h.veriloghdl" }
: Sets the default formatter for Verilog files to the Verilog-HDL extension."verilog.formatting.verilogHDL.formatter": "verible-verilog-format"
: Specifies Verible as the formatter for Verilog files."verilog.formatting.veribleVerilogFormatter.arguments"
: Provides arguments for the Verible formatter to align various elements and set indentation spaces."verible.arguments"
: Lists additional arguments for Verible, including rules to disable, the file list path, and indentation spaces."verible.path"
: Specifies the path to the Verible language server.
These settings help maintain consistent code formatting and improve the development experience when working with Verilog in VSCode.