Blue Pearl VS Code Integration
This VS Code extension integrates Blue Pearl Systems (BPS) HDL linting directly into your development workflow. Lint your Verilog, SystemVerilog, and VHDL files and view results in VS Code's Problems panel.
Features
- Lint Current File: Run Blue Pearl linter on the currently open HDL file
- Lint Workspace: Lint all HDL files in your workspace
- Real-time Diagnostics: View linting errors and warnings in the Problems panel
- Problem Navigation: Click on issues to jump directly to the problematic code
- Lint on Save: Optionally run linter automatically when saving files
- Customizable: Configure Blue Pearl executable path and additional arguments
Prerequisites
- Blue Pearl Systems (BPS) installed and accessible from command line
- VS Code 1.80.0 or higher
- TCL support in your Blue Pearl installation
Installation
Option 1: Install as VS Code Extension
Build the extension:
cd c:\hdl_clients\BPS\vscode
npm install
npm run compile
Package the extension:
npx vsce package
Install the .vsix file:
- Open VS Code
- Go to Extensions view (Ctrl+Shift+X)
- Click "..." menu → "Install from VSIX..."
- Select the generated
.vsix file
Option 2: Run in Development Mode
Install dependencies:
cd c:\hdl_clients\BPS\vscode
npm install
Open in VS Code:
code .
Press F5 to launch Extension Development Host
Configuration
Open VS Code settings (File → Preferences → Settings) and search for "Blue Pearl":
bluepearl.executablePath
- Type:
string
- Default:
"bluepearl"
- Description: Path to Blue Pearl executable
- Example:
"C:\\BluePearl\\bin\\bluepearl.exe"
bluepearl.tclScriptPath
- Type:
string
- Default:
"${workspaceFolder}/bluepearl_lint.tcl"
- Description: Path to TCL linting script
- Example:
"${workspaceFolder}/scripts/bluepearl_advanced_lint.tcl"
bluepearl.lintOnSave
- Type:
boolean
- Default:
false
- Description: Automatically run linter when saving HDL files
bluepearl.additionalArgs
- Type:
array
- Default:
[]
- Description: Additional command-line arguments for Blue Pearl
- Example:
["-gui", "-verbose"]
Example settings.json:
{
"bluepearl.executablePath": "C:\\BluePearl\\bin\\bluepearl.exe",
"bluepearl.tclScriptPath": "${workspaceFolder}/bluepearl_advanced_lint.tcl",
"bluepearl.lintOnSave": true,
"bluepearl.additionalArgs": ["-batch"]
}
Usage
Command Palette
Open the Command Palette (Ctrl+Shift+P) and type:
- Blue Pearl: Lint Current File - Lint the currently open file
- Blue Pearl: Lint Workspace - Lint all HDL files in workspace
- Blue Pearl: Clear Diagnostics - Clear all Blue Pearl diagnostics
Tasks
Run pre-configured tasks via Terminal → Run Task:
- Blue Pearl: Lint Current File - Uses problem matcher for inline diagnostics
- Blue Pearl: Lint All HDL Files - Batch lint multiple files
- Blue Pearl: Lint with Advanced Options - Customizable linting options
Keyboard Shortcuts (Optional)
Add to keybindings.json:
[
{
"key": "ctrl+shift+b",
"command": "bluepearl.lintCurrentFile",
"when": "editorLangId =~ /verilog|systemverilog|vhdl/"
}
]
TCL Script Customization
The extension includes two TCL scripts that you need to customize for your Blue Pearl installation:
1. bluepearl_lint.tcl (Basic)
Simple template for quick linting. Edit the lint_file procedure to add your Blue Pearl API calls.
2. bluepearl_advanced_lint.tcl (Advanced)
Full-featured script with:
- Command-line argument parsing
- Multiple output formats
- Severity filtering
- Batch file processing
Important: Replace the placeholder comments with your actual Blue Pearl TCL commands:
# Example Blue Pearl commands (customize for your installation):
#
# 1. Create/open project
# create_project -name temp_lint_project
#
# 2. Add file to project
# add_file -type $file_type $filepath
#
# 3. Run analysis
# run_analysis -type lint
#
# 4. Get violations and format them
# set violations [get_violations]
# foreach violation $violations {
# format_message [dict get $violation severity] $filepath [dict get $violation line] [dict get $violation message]
# }
The TCL scripts should output messages in one of these formats for proper parsing:
ERROR: filename.v:123: Signal 'clk' is not used
WARNING: filename.sv:45: Variable 'data' might not be initialized
INFO: filename.vhd:10: Port 'enable' connected successfully
ERROR: File: filename.v Line: 123
Signal 'clk' is not used
WARNING: File: filename.sv Line: 45
Variable 'data' might not be initialized
Troubleshooting
Extension Not Activating
- Ensure you're working with HDL files (.v, .sv, .vhd, etc.)
- Check VS Code's Output panel (View → Output → Blue Pearl)
Linter Not Running
- Verify Blue Pearl executable path:
bluepearl -version
- Check TCL script path in settings
- Verify TCL script has executable permissions
No Diagnostics Appearing
- Check the Terminal output for errors
- Ensure your TCL script outputs in the correct format
- Look in Problems panel (View → Problems)
Command Not Found
- Add Blue Pearl to system PATH
- Or specify full path in
bluepearl.executablePath setting
Development
Build
npm run compile
Watch Mode
npm run watch
Package
npx vsce package
Project Structure
c:\hdl_clients\BPS\vscode\
├── .vscode/
│ ├── tasks.json # Pre-configured tasks
│ ├── settings.json # Default settings
│ └── extensions.json # Recommended extensions
├── src/
│ └── extension.ts # Main extension code
├── bluepearl_lint.tcl # Basic TCL linting script
├── bluepearl_advanced_lint.tcl # Advanced TCL linting script
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Contributing
When modifying the extension:
- Update the TCL scripts to match your Blue Pearl API
- Test with your HDL files
- Adjust problem matchers if output format changes
- Update documentation
License
[Specify your license here]
Support
For issues related to:
- Extension: Check the GitHub repository or contact your VS Code admin
- Blue Pearl: Refer to Blue Pearl Systems documentation
- TCL Scripts: Customize based on your BPS installation manual
Version History
0.1.0 (Initial Release)
- Basic linting functionality
- Command palette integration
- Problem matcher support
- Configurable settings
- Task integration