Installation Guideο
This guide will help you set up the VHDL Digital Design Samples project on your local machine.
Prerequisitesο
Before you begin, ensure you have the following installed:
System Requirementsο
Operating System: macOS, Linux (Ubuntu/Debian), or Windows with WSL
Memory: At least 2GB RAM
Storage: 100MB free space
Internet: Required for downloading dependencies
Required Softwareο
Git (for cloning the repository)
GHDL (VHDL simulator and compiler)
Make (build system)
Python 3.7+ (for documentation, optional)
Installation Stepsο
Step 1: Clone the Repositoryο
git clone https://github.com/shishir-dey/vhdl-samples.git
cd vhdl-samples
Step 2: Install GHDLο
On macOS (using Homebrew):
# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install GHDL
brew install ghdl
On Ubuntu/Debian:
sudo apt-get update
sudo apt-get install ghdl
On Windows (using WSL):
First, install Windows Subsystem for Linux (WSL), then follow the Ubuntu instructions.
Verify Installation:
ghdl --version
You should see output similar to:
GHDL 5.0.1 (4.1.0.r602.g37ad91899) [Dunoon edition]
Step 3: Verify Makeο
Check if Make is installed:
make --version
If not installed:
On macOS:
xcode-select --install
On Ubuntu/Debian:
sudo apt-get install build-essential
Step 4: Test the Installationο
Run the projectβs test suite to verify everything is working:
make test
Expected output:
β GHDL found: GHDL 5.0.1 (4.1.0.r602.g37ad91899) [Dunoon edition]
Running complete test suite...
==================================================
VHDL Test Suite Runner
==================================================
=== Testing gates ===
Testing: or_gate_tb
β Test passed
Testing: xor_testbench
β Test passed
=== Testing combinational ===
Testing: decoder_2x4_testbench
β Test passed
Testing: mux_2x1_tb
β Test passed
Testing: fa_testbench
β Test passed
Testing: ha_behave_tb
β Test passed
Testing: rc_adder_testbench
β Test passed
=== Testing sequential ===
Testing: d_flip_flop_tb
β Test passed
Total Tests: 8
Passed: 8
Failed: 0
π All tests passed!
Optional: Documentation Setupο
If you want to build the documentation locally:
# Install Python dependencies
pip install -r docs/requirements.txt
# Build documentation
cd docs
make html
# View documentation
open _build/html/index.html # macOS
xdg-open _build/html/index.html # Linux
Quick Start Commandsο
Once installed, here are the most useful commands:
# Show all available targets
make help
# Run all tests
make test
# Test specific categories
make test-gates
make test-combinational
make test-sequential
# Test individual components
make test-or-gate
make test-decoder
make test-dff
# Build all sources (syntax check)
make build
# Show project statistics
make stats
# Clean build artifacts
make clean
Troubleshootingο
Common Issuesο
GHDL not found:
Error: GHDL is not installed or not in PATH
Solution: Ensure GHDL is properly installed and in your systemβs PATH.
Permission denied:
./scripts/run_tests.sh: Permission denied
Solution: Make the script executable:
chmod +x scripts/run_tests.sh
Test failures:
β Some tests failed.
Solution: Check the detailed error messages and ensure your GHDL version is compatible.
Make command not found:
Solution: Install build tools for your platform (see Step 3 above).
Getting Helpο
If you encounter issues:
Check the Changelog for known issues
Search existing GitHub Issues
Create a new issue with: - Your operating system - GHDL version (
ghdl --version
) - Complete error message - Steps to reproduce
Development Environmentο
For development work, consider installing:
Code Editor Extensions:
VS Code: VHDL Language Support extension
Vim:
vim-vhdl
pluginEmacs: VHDL mode
Additional Tools:
# Wave viewer for signal analysis
brew install gtkwave # macOS
sudo apt-get install gtkwave # Ubuntu
Environment Variables:
Add to your .bashrc
or .zshrc
:
export VHDL_SAMPLES_HOME=/path/to/vhdl-samples
export PATH=$PATH:$VHDL_SAMPLES_HOME/scripts
Next Stepsο
After successful installation:
Explore the Quick Start Guide guide
Learn about the Project Structure
Run through the Basic Logic Gates examples
Try Contributing Guide your own components
Performance Optimizationο
For faster compilation and testing:
Parallel Testing:
# Use multiple cores for faster builds
export MAKEFLAGS=-j$(nproc) # Linux
export MAKEFLAGS=-j$(sysctl -n hw.ncpu) # macOS
GHDL Optimization:
# Add to ~/.bashrc for faster GHDL compilation
export GHDL_PREFIX=/opt/homebrew # macOS with Homebrew
export GHDL_PREFIX=/usr # Linux
System Integrationο
IDE Integration:
Most modern IDEs can be configured to use the projectβs Makefile:
Build Command:
make build
Test Command:
make test
Clean Command:
make clean
Shell Completion:
For Bash/Zsh completion of make targets:
# Add to your shell config
complete -W "$(make -pRrq : 2>/dev/null | awk -F: '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ {split($1,A,/ /);for(i in A)print A[i]}' | sort -u)" make