vw is a command-line tool for managing VHDL workspaces, dependencies, and testbench execution,
similar in spirit to Rust's cargo. It focuses on dependency management, language server
integration, and intelligent testbench simulation using NVC.
- Dependency Management: Add, remove, and update VHDL dependencies from git repositories
- Smart Caching: Dependencies are cached locally to avoid repeated downloads
- Language Server Integration: Automatically generates
vhdl_ls.tomlconfiguration - Testbench Execution: Intelligent NVC-based testbench simulation with dependency analysis
- Flexible Source Paths: Specify directories, individual files, or glob patterns to select VHDL sources
- Lock File Support: Tracks exact dependency versions with
vw.lock
Build from source:
cargo install --path .-
Initialize a new workspace:
vw init my-project
-
Add a dependency:
vw add https://github.com/user/repo --branch main --src hdl/src
-
Update dependencies:
vw update
-
Run testbenches:
# List available testbenches vw test --list # Run a specific testbench vw test my_design_tb # Run with specific VHDL standard vw test my_design_tb --std 2008
Example workspace configuration file:
[workspace]
name = "my-project"
version = "0.1.0"
# Directory-based dependency (with optional recursive flag)
[dependencies.quartz]
repo = "https://github.com/oxidecomputer/quartz"
branch = "main"
src = "hdl/ip/vhd"
recursive = true # Include subdirectories (default: false)
# Single file dependency
[dependencies.uart-lib]
repo = "https://github.com/user/vhdl-libs"
commit = "abc123..."
src = "src/uart_pkg.vhd"
# Glob pattern dependency (matches multiple files/directories)
[dependencies.common-utils]
repo = "https://github.com/user/common"
branch = "main"
src = "lib/**/*_pkg.vhd" # All package files in lib/ subdirectoriesThe src property supports three formats:
- Directory:
"hdl/src"- All VHDL files in the directory (userecursive = truefor subdirectories) - Single file:
"hdl/src/uart.vhd"- One specific file - Glob pattern:
"hdl/**/*.vhd"or"src/*_pkg.vhd"- Pattern matching files
Lock file tracking exact dependency versions:
[dependencies.quartz]
repo = "https://github.com/oxidecomputer/quartz"
commit = "3084a34e3c83f8b45cda7ea428f8fcc8f17484c2"
src = "hdl/ip/vhd"
path = "$HOME/.vw/deps/quartz-3084a34e3c83f8b45cda7ea428f8fcc8f17484c2"Automatically generated configuration for the vhdl_ls language server:
[libraries.quartz]
files = [
"$HOME/.vw/deps/quartz-3084a34e3c83f8b45cda7ea428f8fcc8f17484c2/common/utils/calc_pkg.vhd",
# ... more files
]- Dependency Resolution: When you run
vw update, the tool resolves branch names to specific commit hashes - Caching: Dependencies are downloaded to
$HOME/.vw/deps/<name>-<commit>/ - File Filtering: Only VHDL files (
.vhdand.vhdl) matching thesrcpattern are cached- Directories: All VHDL files in the directory (optionally recursive)
- Single files: Just that specific file
- Glob patterns: All files matching the pattern (e.g.,
hdl/**/*.vhd,src/*_pkg.vhd)
- Language Server Config: The tool merges dependency information with any existing
vhdl_ls.tomlconfiguration
"hdl/**/*.vhd"- All.vhdfiles recursively underhdl/"src/*_pkg.vhd"- All package files directly insrc/"lib/**/{uart,spi}*.vhd"- UART and SPI files anywhere underlib/"*.vhd"- All.vhdfiles in the repository root"hdl/*/pkg/*.vhd"- Package files in any subdirectory ofhdl/*/pkg/
vw test provides intelligent testbench execution using NVC simulator:
-
Smart Dependency Analysis: Analyzes VHDL files to find only the dependencies actually needed:
- Detects
use work.package_namestatements - Finds direct entity instantiations like
entity work.entity_name - Follows component declarations and instantiations
- Recursively resolves dependency chains
- Detects
-
Intelligent Filtering:
- Includes only referenced files from your source code
- Excludes other testbenches while allowing common bench utilities
- Uses proper topological sorting for correct compilation order
-
NVC Integration:
- Analyzes external libraries first with proper library names
- Compiles and runs testbenches with optimized file sets
- Generates FST waveform files for debugging
- Provides clear error messages with exact commands run
my-project/
├── vw.toml # Workspace configuration
├── vw.lock # Dependency lock file
├── vhdl_ls.toml # Language server configuration (auto-generated)
├── src/
│ ├── my_design.vhd # Your VHDL source files
│ └── my_package.vhd # VHDL packages
└── bench/
├── my_design_tb.vhd # Testbenches
├── other_tb.vhd # Additional testbenches
└── test_utils.vhd # Common test utilities
See the example/ directory for a sample workspace configuration.