This repo contains VHDL examples and associated tests. It's intended to provide an environment for testing FPGA candidates.
This repo is intended to be run on some flavour of Linux. I do most of my dev work on Ubuntu at the moment.
- Create a new python venv:
python3 -m venv venv
- Activate your new environment:
source venv/bin/activate
- Install the required packages from
requirements.txt
:pip install -r tools/requirements.txt
- Install GHDL (an open source VHDL simulator) through your package manager:
- On ubuntu and debian systems this would be
sudo apt-get install ghdl
- On archlinux-based distros there is a package in the aur
- On ubuntu and debian systems this would be
The entry point for all tests is through pytest
(https://docs.pytest.org/en/7.1.x/contents.html) which can be run from the top level of this repo.
Some useful pytest
basics:
pytest --collect-only
: just find all the tests and print a listpytest -k "<EXPRESSION>"
: run all tests whose name matchesEXPRESSION
. e.g.pytest -k "pipe"
- Copy
reg_stage.vhd
andtest_reg_stage.py
either just next to where they are in theexamples
top-level-dir or to thesrc
top-level-dir. Give them a name that reflects your new module's purpose, depending on the task you've been given by the tester. - Update the name of the your new module in the
*.vhd
file you just copied. Make it the same as the filename, without the.vhd
extension. - Update the name of the test function and all the paths, DUT names, and module references in the
*.py
test file you just copied (just search forreg_stage
and you should find all the places that need to change) - Run your new test on your new module to make sure all the plumbing is in place:
pytest -k "<your_test_name>
- Start implementing actual new functionality and tests!