Build Systemο
Overview of the Make-based build system for VHDL development.
Overviewο
The project uses a comprehensive Makefile to automate:
Compilation: GHDL-based VHDL compilation
Testing: Automated test execution
Documentation: Sphinx documentation building
Project management: Statistics and cleanup
Make Targetsο
Core Targetsο
make help # Show all available targets
make test # Run complete test suite
make build # Compile all VHDL sources
make clean # Remove build artifacts
Testing Targetsο
make test-gates # Test basic gates only
make test-combinational # Test combinational logic
make test-sequential # Test sequential logic
make test-or-gate # Test specific component
make test-decoder # Test specific component
make test-dff # Test specific component
Documentation Targetsο
make docs # Build documentation
make docs-serve # Serve documentation locally
make docs-dev # Development mode (build + serve)
make docs-clean # Clean documentation build
make docs-check # Check for broken links
make docs-install # Install Python dependencies
Utility Targetsο
make stats # Show project statistics
make list-components # List all VHDL components
make install # Install GHDL (macOS only)
make check-ghdl # Verify GHDL installation
Build Configurationο
GHDL Settings:
Standard: VHDLβ08
Work Directory:
work/
Flags:
--std=08
File Organization:
The build system automatically discovers:
Source files in
src/
hierarchyTest files in
test/
hierarchyBuilds in isolated
work/
directory
Parallel Execution:
# Use multiple CPU cores
export MAKEFLAGS=-j$(nproc) # Linux
export MAKEFLAGS=-j$(sysctl -n hw.ncpu) # macOS
Customizationο
Environment Variables:
export GHDL=ghdl-custom # Use custom GHDL binary
export GHDL_FLAGS="--std=93" # Use VHDL'93 standard
Adding New Targets:
To add a new component test:
test-my-component: check-ghdl $(WORK_DIR)
@cd $(WORK_DIR) && \
$(GHDL) -a ../src/path/my_component.vhd && \
$(GHDL) -a ../test/path/my_component_tb.vhd && \
$(GHDL) -e my_component_tb && \
$(GHDL) -r my_component_tb --stop-time=1ms && \
echo "$(GREEN)β My Component test passed$(NC)"
Dependenciesο
Required Tools:
GHDL: VHDL compiler and simulator
Make: Build automation (GNU Make 3.81+)
Git: Version control
Optional Tools:
Python 3.7+: For documentation
GTKWave: Waveform viewer for debugging