Testing Frameworkο
Documentation for the VHDL testing infrastructure and methodologies.
Note
This section provides details about the projectβs testing approach and tools.
Overviewο
The VHDL Digital Design Samples project uses a comprehensive testing framework built around:
GHDL: Open-source VHDL simulator
Assertion-based testing: Built-in VHDL assertions for verification
Automated test runner: Shell script for batch testing
Make integration: Convenient build system targets
Test Structureο
All tests follow a consistent pattern and are organized to mirror the source structure.
Test Organizationο
test/
βββ gates/ # Basic gate tests
βββ combinational/ # Combinational logic tests
βββ sequential/ # Sequential logic tests
Test Naming Conventionο
Source file:
component_name.vhd
Test file:
component_name_tb.vhd
orcomponent_name_testbench.vhd
Test entity: Matches testbench filename
Running Testsο
Run all tests:
make test
Run by category:
make test-gates
make test-combinational
make test-sequential
Run individual tests:
make test-or-gate
make test-decoder
make test-dff
Test Methodologyο
Each testbench follows these principles:
Complete coverage: Test all input combinations where feasible
Assertion-based verification: Use VHDL assertions for automatic checking
Clear timing: Proper setup and hold times
Self-checking: Tests pass or fail without manual inspection
For more details, see Test Coverage and CI/CD Pipeline.