Extending
Note
All <TOOL> classes inherit from Project
(project.py
).
This is a guide on how to add support for a new TOOL.
Add support for the new tool
pyfpga/templates/<NEWTOOL>.jinja
pyfpga/templates/<NEWTOOL>-prog.jinja
pyfpga/<NEWTOOL>.py
pyfpga/factory.py # UPDATE
pyfpga/helpers/prj2bit.py # UPDATE
Add tests and tools mock-ups
tests/test_tools.py # UPDATE
tests/regress.sh # UPDATE
tests/support.py # UPDATE if exceptions are needed
tests/mocks/<NEWCOMMAND>
Add examples
examples/sources/cons/<NEWBOARD>/timing.<EXT>
examples/sources/cons/<NEWBOARD>/clk.<EXT>
examples/sources/cons/<NEWBOARD>/led.<EXT>
examples/projects/<NEWTOOL>.py
examples/helpers/<NEWTOOL>.sh
examples/hooks/<NEWTOOL>.py # OPTIONAL
Verify the code
Run it at the root of the repo.
make docs
make lint
make test
Tip
You can simply run make
to perform all the operations.
Running make clean
will remove all the generated files.
Verify the functionality
cd tests
python3 support.py --tool <NEWTOOL>
Updated the documentation
README.md
docs/intro.rst
docs/tools.rst