Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #36

Open
wants to merge 244 commits into
base: main
Choose a base branch
from
Open

Dev #36

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
244 commits
Select commit Hold shift + click to select a range
3d9b185
Updated README.md and modified version (0.3.0-dev)
rodrigomelo9 May 15, 2022
c18b44b
resources: submodule added
rodrigomelo9 May 15, 2022
1e8a546
test: added mocks (for vendors tools)
rodrigomelo9 May 23, 2022
06c31d4
ci: fixed an 'exit status 2' issue
rodrigomelo9 May 25, 2022
b896134
ci: added python 3.10
rodrigomelo9 May 25, 2022
fda3a82
ci: added schedule based on cron
rodrigomelo9 May 25, 2022
dbfc133
fpga: renamed add_path as add_vlog_include
rodrigomelo9 May 26, 2022
579f275
fpga: added add_vlog_define and set_vhdl_arch in project.py (not impl…
rodrigomelo9 May 26, 2022
6699cd9
fpga: renamed set_param as add_param
rodrigomelo9 May 27, 2022
d1bd35c
fpga: renamed 'imp' as 'par'
rodrigomelo9 May 27, 2022
bbdc605
Updated shields in README.md
rodrigomelo9 May 27, 2022
fe8bcbc
fpga: renamed 'init' as 'meta'
rodrigomelo9 May 27, 2022
8777ee8
fix: ModuleNotFoundError: No module named 'fpga.helpers'
lmcapacho Jan 31, 2023
7f49fdf
Improved existing mocks
rodrigomelo9 May 20, 2024
31e33d1
Merge branch 'rewrite' of github.com:PyFPGA/pyfpga into rewrite
rodrigomelo9 May 20, 2024
4cc3513
Added a new WIP Project class under the pyfpga directory
rodrigomelo9 May 26, 2024
a9a25b1
ci: updated, modified to analyze pyfpga instead of fpga
rodrigomelo9 May 26, 2024
4b037ae
ci: renamed doc as docs, disabled docs and test
rodrigomelo9 May 26, 2024
8288159
ci: fixed lint action
rodrigomelo9 May 26, 2024
7347667
ci: updated Makefile and used for the lint action
rodrigomelo9 May 26, 2024
4d845b6
Modified project to employ enumerations
rodrigomelo9 May 26, 2024
049af6b
Added docs with the skeleton generated by sphinx-quickstart
rodrigomelo9 May 26, 2024
2f67bde
ci: updated docs
rodrigomelo9 May 26, 2024
35534eb
Moved content from doc/images into docs/images and docs/_static
rodrigomelo9 May 26, 2024
fe57927
Moved doc contento to docs/wip
rodrigomelo9 May 26, 2024
0717dc1
docs: added intro (empty) and api (automodule)
rodrigomelo9 May 26, 2024
33bfdcc
ci: updated/enabled docs
rodrigomelo9 May 26, 2024
ece35b0
Removed unused config files
rodrigomelo9 May 26, 2024
c2957c0
ci: updated docs and lint to be similar
rodrigomelo9 May 26, 2024
3d29a99
docs: fixed to find pyfpga.project
rodrigomelo9 May 26, 2024
fa24be1
Implemented some simple methods of project.py
rodrigomelo9 May 26, 2024
c545884
ci: simplified/enabled test
rodrigomelo9 May 26, 2024
d886fb3
Added the target docs at Makefile
rodrigomelo9 May 28, 2024
5d798be
Renamed test to tests
rodrigomelo9 May 28, 2024
833cb4a
Removed tool and data from Project
rodrigomelo9 May 28, 2024
292e6ea
ci: attempt to fix test
rodrigomelo9 May 28, 2024
13b5169
Added add_cons for constraint files
rodrigomelo9 May 28, 2024
f6958f6
Added logging into the new Project class and an example
rodrigomelo9 May 29, 2024
9bcc170
Added a Makefile target to update the resources module
rodrigomelo9 May 29, 2024
1b2fbe9
Renamed logging.py as logger.py (examples/misc) to avoid circular dep…
rodrigomelo9 May 29, 2024
abbb2b5
Added a private method to run the underlaying tool
rodrigomelo9 May 30, 2024
1b1f5a2
Replaced add_hook by a one functions for each hook
rodrigomelo9 May 30, 2024
992cfab
docs: added hooks
rodrigomelo9 May 30, 2024
b9700cd
Updated the NOTICE about PyFPGA being rewritten
rodrigomelo9 May 30, 2024
5c9f31e
Moved templates from fpga/tool to pyfpga/templates
rodrigomelo9 May 30, 2024
93eeb26
Content of vivado.jinja was split into 4 templates
rodrigomelo9 May 30, 2024
5c2ad6f
Templates clean-up
rodrigomelo9 May 30, 2024
b20db61
Added two hook stages, returned to the single function version
rodrigomelo9 May 31, 2024
b48ad68
Templates simplified, still WIP
rodrigomelo9 Jun 1, 2024
52e82f1
Renamed step PRJ as CFG
rodrigomelo9 Jun 1, 2024
d1eb4b1
Last iteration on templates before final customization
rodrigomelo9 Jun 1, 2024
504b1fc
docs: re-added previously removed sections, with a WIP notice
rodrigomelo9 Jun 1, 2024
a01bcd7
README updated/simplified
rodrigomelo9 Jun 1, 2024
087e3a6
Moved helpers from fpga to pyfpga
rodrigomelo9 Jun 1, 2024
e9f2dca
Renamed fpga/project.py as pyfpga/factory.py
rodrigomelo9 Jun 1, 2024
b6a0356
Simplified some methods at project, defined internal data structure, …
rodrigomelo9 Jun 1, 2024
16b3999
Fixed pylint complaint
rodrigomelo9 Jun 1, 2024
2bf79bc
Fixed pylint complaints
rodrigomelo9 Jun 1, 2024
c88eaa6
Renamed and implemented _add_file, implemented add_hook
rodrigomelo9 Jun 1, 2024
ecb3aa4
Added some pending doc-strings
rodrigomelo9 Jun 2, 2024
316dfdc
Removed already processed things
rodrigomelo9 Jun 2, 2024
739b12f
Removed test_top.py (top autodiscovery was deprecated)
rodrigomelo9 Jun 2, 2024
62e2fd9
Renamed hooks as internals, added info about the internal data structure
rodrigomelo9 Jun 2, 2024
ea3c468
Added a directory with empty files, to test methods that deal with di…
rodrigomelo9 Jun 2, 2024
1455a09
Removed unused things
rodrigomelo9 Jun 2, 2024
df2a2a2
Removed test_files.py
rodrigomelo9 Jun 2, 2024
79175ed
Implemented directory/file exists check
rodrigomelo9 Jun 2, 2024
53bb363
Moved things from fpga to pyfpga
rodrigomelo9 Jun 5, 2024
29aae52
Removed unused things, commented others
rodrigomelo9 Jun 5, 2024
7d10d7b
Added to check if the needed underlying tool is available
rodrigomelo9 Jun 5, 2024
b1c2682
Removed unused things
rodrigomelo9 Jun 5, 2024
6abcbd5
Moved things from Python scripts to templates
rodrigomelo9 Jun 6, 2024
713bbc7
Added a method to create files based on templates
rodrigomelo9 Jun 7, 2024
e506e2f
Tool-specific data reorganized
rodrigomelo9 Jun 7, 2024
bebd9e8
Ignored results
rodrigomelo9 Jun 7, 2024
f496a2a
Removed unused imports
rodrigomelo9 Jun 7, 2024
cf81ebf
Modified how to deal with steps; started the Vivado implementation
rodrigomelo9 Jun 10, 2024
d02b81e
Implemented use of arch, defines, includes and params
rodrigomelo9 Jun 11, 2024
6824d99
Fixed linter issues
rodrigomelo9 Jun 17, 2024
b178c92
Added add_fileset, to be implemented
rodrigomelo9 Jun 17, 2024
f77f214
Slightly modified the internal data structure
rodrigomelo9 Jun 18, 2024
b17a200
More small adjustments in the internal data structure
rodrigomelo9 Jun 20, 2024
2c087d6
Finished implementation of _make_prepare for Vivado
rodrigomelo9 Jun 20, 2024
cf20113
Moved submodule 'resources' to 'examples/resources'
rodrigomelo9 Jun 20, 2024
0d6ad2a
Removed 'hdl', superseded by 'examples/resources'
rodrigomelo9 Jun 20, 2024
293d1f0
Updated resources, removed zybo.xdc
rodrigomelo9 Jun 20, 2024
07e53be
Updated Vivado example to use the new PyFPGA
rodrigomelo9 Jun 20, 2024
d3bb077
Fixed double timestamp
rodrigomelo9 Jun 20, 2024
804bcc1
Added a script to enable mock-ups
rodrigomelo9 Jun 23, 2024
33429d0
Improved some messages and how to indicate the command to run
rodrigomelo9 Jun 23, 2024
a2cd412
Modified to print the last 20 lines of the log file
rodrigomelo9 Jun 23, 2024
bbcd7a1
Added new sources, updated the Vivado example
rodrigomelo9 Jun 23, 2024
3a4d717
Implemented programming with Vivado
rodrigomelo9 Jun 24, 2024
2bb960c
ci: added to install pyfpga and prepare mock-ups
rodrigomelo9 Jun 24, 2024
eb7c046
Fixed/updated package name
rodrigomelo9 Jun 24, 2024
4177a8b
Fixed/updated package name, added jinja2 as dependency, deprecated Py…
rodrigomelo9 Jun 24, 2024
80cfbce
Updated the header of the mocks
rodrigomelo9 Jun 24, 2024
57149f8
Updated README.md
rodrigomelo9 Jun 24, 2024
33ea70b
Renamed add_constraint as add_cons
rodrigomelo9 Jun 24, 2024
cefcc9a
Removed support for VHDL architectures
rodrigomelo9 Jun 24, 2024
9584c49
Removed unused files
rodrigomelo9 Jun 24, 2024
b04a222
Moved the zybo constraints from the Vivado example to sources
rodrigomelo9 Jun 24, 2024
8fcf3d7
Simplified Vivado example content
rodrigomelo9 Jun 24, 2024
6c68caf
Added support for the Arty A7 35T in the Vivado example
rodrigomelo9 Jun 25, 2024
c0b02c6
Added initial (very early stage) support for Openflow
rodrigomelo9 Jun 26, 2024
aaef6c1
Removed resources submodule
rodrigomelo9 Jun 26, 2024
ed239f9
Modified HDL to depends on more than one param/include/define
rodrigomelo9 Jun 26, 2024
12ab0a4
Small fix
rodrigomelo9 Jun 26, 2024
e61cf5b
Simplified Openflow example content
rodrigomelo9 Jun 26, 2024
b52435e
Removed deprecated files
rodrigomelo9 Jun 26, 2024
548d7ab
Implemented par and bit for Openflow
rodrigomelo9 Jun 28, 2024
69ae00b
Prepared template for Openflow programming
rodrigomelo9 Jun 28, 2024
1d1c157
Added get_info to obtain extra information based on the PART
rodrigomelo9 Jun 28, 2024
7031a18
Re-added ISE support
rodrigomelo9 Jun 29, 2024
f004494
Fixed to include ISE XST constraints
rodrigomelo9 Jun 29, 2024
349af14
Modified to have different log files for make and prog
rodrigomelo9 Jun 29, 2024
47cb942
Small fix on quartus-prog and prepared ise-prog
rodrigomelo9 Jun 29, 2024
7e13dc7
Added missing import of Path
rodrigomelo9 Jun 29, 2024
f2fa17f
Added to raise an exception for Libero programming
rodrigomelo9 Jun 29, 2024
fa66cfa
Re-added Quartus support (WIP)
rodrigomelo9 Jun 29, 2024
2b34189
Fix duplicate logging issue when creating new instances
rodrigomelo9 Jun 29, 2024
c8841d5
Add a test to verify support of the specified tool
rodrigomelo9 Jun 29, 2024
d8eebcf
Improve/simplify the generation of an intentional error
rodrigomelo9 Jun 30, 2024
032a8e1
Fix VHDL libraries support for ISE
rodrigomelo9 Jun 30, 2024
c072eaf
Improve/simplify the test to verify support
rodrigomelo9 Jun 30, 2024
f403d88
Add a script to run the ISE examples
rodrigomelo9 Jun 30, 2024
f027f22
Fix pylint complaint
rodrigomelo9 Jun 30, 2024
daf7f7c
Add checking of success to force an error if not
rodrigomelo9 Jun 30, 2024
23a89d7
Modified default part
rodrigomelo9 Jun 30, 2024
b26ac58
Fix SystemVerilog test
rodrigomelo9 Jun 30, 2024
063c5bb
Fix Vivado mock-up after last changes on the Vivado template
rodrigomelo9 Jun 30, 2024
73417f8
Clean-up
rodrigomelo9 Jun 30, 2024
030b335
Re-added support for Libero (WIP)
rodrigomelo9 Jul 1, 2024
6ae7ce5
Fix quartus_sh mock-up
rodrigomelo9 Jul 2, 2024
4b8fe9e
Fix ecp5 flow
rodrigomelo9 Jul 2, 2024
4769fe2
Fix to abort if the bit file doesn't exists
rodrigomelo9 Jul 2, 2024
17af7b6
Merged several examples under the project directory
rodrigomelo9 Jul 2, 2024
bce2b2f
Removed deprecated files/examples
rodrigomelo9 Jul 2, 2024
db4a4ea
Moved constraint files under the cons directory
rodrigomelo9 Jul 2, 2024
ba268ee
Added a list of similar projects
rodrigomelo9 Jul 4, 2024
b13cc74
Removed an extra add_param
rodrigomelo9 Jul 4, 2024
e153c19
Small improvements
rodrigomelo9 Jul 4, 2024
508f58a
Fix board name
rodrigomelo9 Jul 4, 2024
aa34289
Improved support for Libero (still WIP)
rodrigomelo9 Jul 4, 2024
0c2ecb3
Modify how to generate an intentional error
rodrigomelo9 Jul 4, 2024
8b93f66
Modified to be Libero compatible
rodrigomelo9 Jul 4, 2024
211bbb7
Finished support for Libero
rodrigomelo9 Jul 5, 2024
c64e9f6
Fix value of speed in a Libero test case
rodrigomelo9 Jul 5, 2024
7ddd0e5
Updated tools versions
rodrigomelo9 Jul 5, 2024
154da91
Add to check basic support based on the Blink module
rodrigomelo9 Jul 5, 2024
c00c278
Libero support slightly improved
rodrigomelo9 Jul 5, 2024
7963eb1
Quartus support improved/simplified
rodrigomelo9 Jul 5, 2024
2504099
Applied a few format fixes
rodrigomelo9 Jul 6, 2024
cae0d32
ISE support improved/simplified
rodrigomelo9 Jul 6, 2024
d0226be
Fix intentional error generation for Vivado
rodrigomelo9 Jul 6, 2024
fbd52b1
Vivado support improved/simplified
rodrigomelo9 Jul 6, 2024
8d2a067
Openflow support improved/simplified
rodrigomelo9 Jul 6, 2024
6936d14
Fix SV files inclusion
rodrigomelo9 Jul 6, 2024
ed6257b
Modified to try SV for Openflow
rodrigomelo9 Jul 8, 2024
f249f14
Cosmetic changes to Jinja templates
rodrigomelo9 Jul 8, 2024
0efbd0e
Copyright notice updated
rodrigomelo9 Jul 8, 2024
fa84608
Fix paths in TCL on Windows
rodrigomelo9 Jul 8, 2024
f437eb7
Added comments to easily identify each section
rodrigomelo9 Jul 9, 2024
a343819
Change template variables from uppercase to lowercase
rodrigomelo9 Jul 9, 2024
9e63f29
Modify how the flow steps and hooks are used on the templates
rodrigomelo9 Jul 9, 2024
f4e9c73
Refactor tool classes to simplify implementation
rodrigomelo9 Jul 9, 2024
8e3de75
Fix after last changes
rodrigomelo9 Jul 10, 2024
52985d9
Fix missing check of top
rodrigomelo9 Jul 10, 2024
6cd70eb
Renamed (expanded) test_vivado.py as test_tools.py
rodrigomelo9 Jul 10, 2024
1629745
Fix lint issue
rodrigomelo9 Jul 10, 2024
664e26b
Add to check if resulting files exist
rodrigomelo9 Jul 10, 2024
c6c6558
Renamed parameter name as project
rodrigomelo9 Jul 10, 2024
16799d8
Fix the name of a similar project
rodrigomelo9 Jul 10, 2024
a2e816d
Add a class to deal with multiple tools in the same project
rodrigomelo9 Jul 13, 2024
0657ee2
Remove arch specification
rodrigomelo9 Jul 13, 2024
727ba51
Make STEPS accessible for external access
rodrigomelo9 Jul 13, 2024
3f9f8b4
Make TOOLS accessible for external access
rodrigomelo9 Jul 13, 2024
6661d21
hdl2bit and prj2bit reimplemented
rodrigomelo9 Jul 15, 2024
0df825d
Remove info message not compatible with prj2bit
rodrigomelo9 Jul 15, 2024
2f2cdf3
Implemented new tests for helpers
rodrigomelo9 Jul 15, 2024
79bb0b4
Add workaround for prj2bit
rodrigomelo9 Jul 15, 2024
d9b02da
docs: added helpers
rodrigomelo9 Jul 15, 2024
d713c90
ci: add pyfpga as dependency
rodrigomelo9 Jul 15, 2024
42fe56d
bitprog reimplemented
rodrigomelo9 Jul 17, 2024
995eae3
docs: add bitprog help
rodrigomelo9 Jul 17, 2024
6220dbd
Modified to use TOOLS for choices
rodrigomelo9 Aug 5, 2024
cc89caf
Modify tests to be able of run pytest from project root
rodrigomelo9 Aug 6, 2024
6fecb1d
docs: added new sections
rodrigomelo9 Aug 9, 2024
e36413d
docs: complete introduction section
rodrigomelo9 Aug 9, 2024
9085338
Add Vivado hooks examples
rodrigomelo9 Aug 11, 2024
e1c6ebf
Remove the 'when' parameter from 'add_cons' (Vivado-specific)
rodrigomelo9 Aug 11, 2024
e0943bd
Add a Vivado Elaboration example (using hooks)
rodrigomelo9 Aug 11, 2024
83d1e59
Adds set_debug()
rodrigomelo9 Aug 12, 2024
0103506
docs: rewritten basic usage
rodrigomelo9 Aug 12, 2024
e552a69
docs: rewritten (WIP) advanced usage
rodrigomelo9 Aug 12, 2024
fe6937a
Implement support for Lattice Diamond
m42uko Aug 1, 2024
edd0bd7
Merge pull request #43 from m42uko/feature/diamond
rodrigomelo9 Aug 12, 2024
45995b8
Fix a linter issue
rodrigomelo9 Aug 12, 2024
95afdae
docs: add content to 'Extending'
rodrigomelo9 Aug 12, 2024
dd8e4de
A few constraint files were renamed to maintain names coherency
rodrigomelo9 Aug 12, 2024
d169a7b
Update copyright
rodrigomelo9 Aug 12, 2024
25613a6
docs: 'Tools' rewritten
rodrigomelo9 Aug 13, 2024
29b3d35
docs: 'Internals' updated
rodrigomelo9 Aug 13, 2024
9fb634e
docs: 'advanced' was updated/simplified
rodrigomelo9 Aug 13, 2024
cdfec22
diamond: Use the project name as prefix for the combined constraints
m42uko Aug 22, 2024
520cc50
Merge pull request #50 from m42uko/fix/diamond-prefs
rodrigomelo9 Aug 23, 2024
b2cd5cb
openflow: use the project name as the name for the combined constraints
rodrigomelo9 Aug 23, 2024
e87cde8
openflow: add missing comments
rodrigomelo9 Aug 23, 2024
93d1bb0
Print actual data when adding configurations to a project
gts-bzi Aug 16, 2024
0139c4b
Merge pull request #48 from gts-bzi/feature/enhanced_debug
rodrigomelo9 Aug 29, 2024
1bdbb64
Fix linting issue
rodrigomelo9 Aug 29, 2024
d584bce
docs: add generation timestamp
rodrigomelo9 Aug 30, 2024
d866f8b
openflow: re-added Synthesis for Xilinx devices
rodrigomelo9 Aug 30, 2024
5ae1a81
Added Diamond into regress.sh
rodrigomelo9 Aug 30, 2024
024a89a
examples: modify output directory of projects
rodrigomelo9 Aug 30, 2024
e63851d
examples: remove odir specification in diamond (hooks)
rodrigomelo9 Aug 30, 2024
0d95e01
Add to remove the results directories
rodrigomelo9 Aug 31, 2024
99f235e
docs: minor changes in the generation
rodrigomelo9 Aug 31, 2024
7fc1ab9
Removed an unneeded comment
rodrigomelo9 Aug 31, 2024
ed36ead
tests: moved from projects/support.py to simply support.py
rodrigomelo9 Aug 31, 2024
9188bd8
Add to specify the tool to run in regress.sh
rodrigomelo9 Aug 31, 2024
f203de1
Removed unused targets and added all
rodrigomelo9 Aug 31, 2024
a4ffd5d
docs: improve the extending section
rodrigomelo9 Aug 31, 2024
8f7e89a
examples: renamed yosys as misc
rodrigomelo9 Aug 31, 2024
578ee49
examples: update/simplify README.md
rodrigomelo9 Aug 31, 2024
fbf80e0
diamondc: removed unused import
rodrigomelo9 Aug 31, 2024
884fda8
Simplified how to clean docs
rodrigomelo9 Aug 31, 2024
7851b97
ci: modified when to trigger the docs actions
rodrigomelo9 Aug 31, 2024
c7e5369
openflow: re-added VHDL support (WIP)
rodrigomelo9 Aug 31, 2024
01991d7
openflow: add generics support
rodrigomelo9 Aug 31, 2024
2864ced
openflow: properly re-added VHDL support
rodrigomelo9 Sep 2, 2024
aa29487
docs: add a hint about file processing order
rodrigomelo9 Sep 2, 2024
5aecfde
Merge pull request #53 from PyFPGA/openflow-vhdl
rodrigomelo9 Sep 2, 2024
9a2df31
docs: added a diagram about Openflow
rodrigomelo9 Sep 3, 2024
29ed35a
ci: modified to trigger docs when the branch is main or dev
rodrigomelo9 Sep 3, 2024
9aa363f
ci: add windows tests
rodrigomelo9 Sep 3, 2024
6dc528a
ci: add to run regress.sh
rodrigomelo9 Sep 3, 2024
48af8b2
ci: modified when to trigger the docs actions
rodrigomelo9 Sep 4, 2024
fcd51f6
ci: modified to run ubuntu and windows tests using the same job
rodrigomelo9 Sep 4, 2024
1a0ff91
Add the --notool option, to avoid errors when tools are not available
rodrigomelo9 Sep 7, 2024
8c061c1
ci: fix issue specifyng the Python version
rodrigomelo9 Sep 7, 2024
e3fadf9
Merge pull request #55 from PyFPGA/ci-win
rodrigomelo9 Sep 7, 2024
e313901
tests: checking that paths are posix-like
rodrigomelo9 Sep 8, 2024
d94057e
ci: moved to run regress from test.yml to the Makefile
rodrigomelo9 Sep 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .btd.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/doc.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'docs'

on:
push:
paths:
- 'docs/**'
- 'pyfpga/project.py'
branches:
- main
- dev

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: pip install . && pip install sphinx sphinx-rtd-theme
- name: Build documentation
run: make docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
14 changes: 5 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install pycodestyle
pip install pylint
pip install .
- name: Lint
run: |
pycodestyle fpga examples test
pylint fpga
run: pip install pycodestyle pylint
- name: Run linters
run: make lint
41 changes: 21 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,29 @@ on:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: ['ubuntu', 'windows']
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: 'windows'
pyver: '3.8'
- os: 'windows'
pyver: '3.9'
- os: 'windows'
pyver: '3.10'
- os: 'windows'
pyver: '3.11'
runs-on: ${{ matrix.os }}-latest
name: ${{ matrix.os }} | ${{ matrix.pyver }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.pyver }}
- name: Install dependencies
run: |
pip install pytest
pip install .
- name: Pull container images
run: |
docker pull hdlc/prjtrellis
docker pull hdlc/ghdl:yosys
docker pull hdlc/icestorm
docker pull hdlc/nextpnr:ecp5
docker pull hdlc/nextpnr:ice40
- name: Test
run: |
pytest
make -C examples
run: pip install . && pip install pytest
- name: Run tests
run: make test
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*build
ignore*
results
venv
__pycache__
*.egg-info
_theme
16 changes: 0 additions & 16 deletions .pylintrc

This file was deleted.

23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
#!/usr/bin/make

check:
pycodestyle fpga examples test
pylint -s n fpga
.PHONY: docs

all: docs lint test

docs:
cd docs; make html

lint:
pycodestyle pyfpga examples tests
pylint -s n pyfpga
git diff --check --cached
pytest test

test:
pytest
cd examples/projects && bash regress.sh --notool

clean:
py3clean .
rm -fr build .pytest_cache
rm -fr docs/build
rm -fr .pytest_cache
rm -fr `find . -name results`
rm -fr `find . -name __pycache__`
139 changes: 42 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,132 +1,77 @@
# PyFPGA [![License](https://img.shields.io/badge/License-GPL--3.0-darkgreen?style=flat-square)](LICENSE)

![GDHL](https://img.shields.io/badge/GHDL-last-brightgreen.svg?style=flat-square)
![icestorm](https://img.shields.io/badge/icestorm-last-brightgreen.svg?style=flat-square)
![nextpnr](https://img.shields.io/badge/nextpnr-last-brightgreen.svg?style=flat-square)
![prjtrellis](https://img.shields.io/badge/prjtrellis-last-brightgreen.svg?style=flat-square)
![Yosys](https://img.shields.io/badge/Yosys-last-brightgreen.svg?style=flat-square)

![Diamond](https://img.shields.io/badge/Diamond-3.13-blue.svg?style=flat-square)
![ISE](https://img.shields.io/badge/ISE-14.7-blue.svg?style=flat-square)
![Libero](https://img.shields.io/badge/Libero--Soc-12.2-blue.svg?style=flat-square)
![Quartus](https://img.shields.io/badge/Quartus--Prime-19.1-blue.svg?style=flat-square)
![Vivado](https://img.shields.io/badge/Vivado-2019.2-blue.svg?style=flat-square)

PyFPGA is a **Python** Class for **vendor-independent FPGA development**.
It allows using **a single project file** and **programmatically** executing
**synthesis**, **implementation**, generation of **bitstream** and/or
**transference** to supported boards.
![Libero](https://img.shields.io/badge/Libero--Soc-2024.1-blue.svg?style=flat-square)
![Quartus](https://img.shields.io/badge/Quartus--Prime-23.1-blue.svg?style=flat-square)
![Vivado](https://img.shields.io/badge/Vivado-2022.1-blue.svg?style=flat-square)

- The workflow is command-line centric.
- It's friendly with *Version Control Systems* and *Continuous Integration* (CI).
- Allows reproducibility and repeatability.
- Consumes fewer system resources than GUI based workflows.
![Openflow](https://img.shields.io/badge/Openflow-GHDL%20%7C%20Yosys%20%7C%20nextpnr%20%7C%20icestorm%20%7C%20prjtrellis-darkgreen.svg?style=flat-square)

Create your custom FPGA Tool using a workflow tailored to your needs!
PyFPGA is an abstraction layer for working with FPGA development tools in a vendor-agnostic, programmatic way. It is a Python package that provides:
* One **class** per supported tool for **project creation**, **synthesis**, **place and route**, **bitstream generation**, and **programming**.
* A set of **command-line helpers** for simple projects or quick evaluations.

> **WARNING:** (2022-05-15) PyFPGA is in the process of being strongly rewritten/simplified.
> Most changes are internal, but the API (`Project` class) will change.
With PyFPGA, you can create your own FPGA development workflow tailored to your needs!

## Usage
Some of its benefits are:
* It provides a unified API between tools/devices.
* It's **Version Control Systems** and **Continuous Integration** friendly.
* It ensures reproducibility and repeatability.
* It consumes fewer system resources than GUI-based workflows.

A minimal example of how to use PyFPGA:
## Basic example

```py
from fpga import Project
from pyfpga import Vivado

# Specify the backend tool and an optional project name
prj = Project('vivado', 'example')

# Set the device/part
prj = Vivado('example')
prj.set_part('xc7z010-1-clg400')

# Add HDL sources to the project
prj.add_files('location1/*.v')
prj.add_files('location2/top.v')

# Optionally add constraint files to the project
prj.add_files('location3/example.xdc')

# Set the top-level unit name
prj.add_vlog('location1/*.v')
prj.add_vlog('location2/top.v')
prj.add_cons('location3/example.xdc')
prj.set_top('Top')

# Generate the bitstream running the tool
prj.generate()
prj.make()
```

Now, you can read the [docs](https://pyfpga.github.io/pyfpga/) or find
more examples in subdir [examples](examples).
The next steps are to read the [docs](https://pyfpga.github.io/pyfpga) or take a look at [examples](examples).

The API implemented by the `Project class` provides:
## Support

- A constructor where the TOOL must be specified and an optional PROJECT NAME can be indicated
- Methods to set the target device PART, to add multiple HDL, Constraint and Tcl files to the
project (in case of VHDL an optional PACKAGE NAME can be specified) and to specify the TOP-LEVEL
- Methods to specify a different OUTPUT directory or get some project configurations
- Methods to generate a bitstream and transfer it to a device (running the selected EDA Tool)
- The capability of specifying an optimization strategy (area, power or speed) when the bitstream
is generated
- A method to add Verilog Included File directories
- A method to specify generics/parameters values
- Methods to add Tcl commands in up to six different parts of the Flow (workaround for not yet
implemented features)
- Optional logging capabilities which include the display of the Tool Execution Time
PyFPGA is a Python package developed having GNU/Linux platform on mind, but it should run well on any POSIX-compatible OS, and probably others!
If you encounter compatibility issues, please inform us via the [issues](https://github.com/PyFPGA/pyfpga/issues) tracker.

## Support
For a comprehensive list of supported tools, features and limitations, please refer to the [tools support](https://pyfpga.github.io/pyfpga/tools.html) page.

PyFPGA is a Python 3 package, which is developed on Debian GNU/Linux.
It should run on any other POSIX compatible OS and probably also on different OS.
Should you achieve either success of failure on non-POSIX systems, please let us know through the
[issue](https://github.com/PyFPGA/pyfpga/issues) tracker.

- The whole development flow (from reading HDL and constraint sources to producing a bitstream)
can be performed with ISE (Xilinx), Vivado (Xilinx), Quarts Prime (Intel/Altera), Libero-SoC
(Microsemi) and/or with open-source tools.
- GDHL (`--synth`) allows converting VHDL sources into a VHDL 1993 netlist.
- Yosys allows synthesising Verilog and VHDL (using `ghdl-yosys-plugin`) and supports multiple
output formats: JSON, Verilog, EDIF, etc.
- nextpnr can be used for implementation of JSON netlists.
- Also, ISE and Vivado are supported for implementation of Verilog netlists.
- Transferring bitstreams and programming devices:
- ISE (Impact) can be used for programming FPGAs and/or memories (BPI and SPI) through JTAG.
- Vivado, Quartus and iceprog (IceStorm, for ice40 devices) can be used to programming FPGAs.
- Programming with Libero-SoC and programming ECP5 devices (prjtrellis, openocd) is not yet
supported.

**Notes:**

- The open-source tools are supported trough container images from the
[ghdl/docker](https://github.com/ghdl/docker) project, so
[Docker](https://www.docker.com/) ~~or [Podman](https://podman.io/)~~ must be
installed. The same workflow can be used in CI services.
- ISE, Libero-Soc, Quartus Prime and Vivado, must be ready to be executed from
the terminal (installed and well configured).
> **NOTE:**
> PyFPGA assumes that the underlying tools required for operation are ready to be executed from the running terminal.
> This includes having the tools installed, properly configured and licensed (when needed).

## Installation

PyFPGA requires Python `>=3.6`. For now, it's only available as a git repository
hosted on GitHub. It can be installed with pip:
PyFPGA requires Python>=3.8.

At the moment, it's only available as a git repository hosted on GitHub. It can be installed with pip:

```
pip install 'git+https://github.com/PyFPGA/pyfpga#egg=pyfpga'
```

> On GNU/Linux, installing pip packages on the system requires `sudo`.
> Alternatively, use `--local` for installing PyFPGA in your HOME.

You can get a copy of the repository either through git clone or downloading a
tarball/zipfile:
Alternatively, you can get a copy of the repository either through git clone or downloading a tarball/zipfile, and then:

```
git clone https://github.com/PyFPGA/pyfpga.git
cd pyfpga
pip install -e .
```

Then, use pip from the root of the repo:
> With `-e` (`--editable`) your application is installed into site-packages via a kind of symlink.
> That allows pulling changes through git or changing the branch, avoiding the need to reinstall the package.

```
pip install -e .
```
## Similar projects

> With `-e` (`--editable`) your application is installed into site-packages via
> a kind of symlink. That allows pulling changes through git or changing the
> branch, without the need to reinstall the package.
* [edalize](https://github.com/olofk/edalize): an abstraction library for interfacing EDA tools.
* [Hdlmake](https://ohwr.org/project/hdl-make): tool for generating multi-purpose makefiles for FPGA projects.
* HDL On Git ([Hog](https://gitlab.com/hog-cern/Hog)): a set of Tcl/Shell scripts plus a suitable methodology to handle HDL designs in a GitLab repository.
* IPbus Builder ([IPBB](https://github.com/ipbus/ipbb)): a tool for streamlining the synthesis, implementation and simulation of modular firmware projects over multiple platforms.
* [tsfpga](https://github.com/tsfpga/tsfpga): a flexible and scalable development platform for modern FPGA projects.
Loading