-
Notifications
You must be signed in to change notification settings - Fork 174
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
Driver for openFPGALoader #1402
base: master
Are you sure you want to change the base?
Conversation
fyi: my username is now @enkiusz instead of @mgrela. I moved the repo but the account name in PRs doesn't migrate along with it. Sorry for the Jia Tian moment. |
Ping. Is there any way I can assist with the review/merge process as the author of this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise.
doc/configuration.rst
Outdated
|
||
OpenFPGALoaderDriver: | ||
board: vcu118 | ||
image: 'bitstream.bit' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image: 'bitstream.bit' | |
image: 'mybitstreamkey' |
@enkiusz Please also add the import to |
I have implemented the suggested changes. |
doc/configuration.rst
Outdated
- image (str): optional, key in :ref:`images <labgrid-device-config-images>` containing the path | ||
of the bitstream, if not specified when calling `load()` | ||
- board (str): optional, the FPGA board identifier | ||
- frequency (int): optional, force a non-default programmer frequency in Hz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation:
- image (str): optional, key in :ref:`images <labgrid-device-config-images>` containing the path | |
of the bitstream, if not specified when calling `load()` | |
- board (str): optional, the FPGA board identifier | |
- frequency (int): optional, force a non-default programmer frequency in Hz | |
- image (str): optional, key in :ref:`images <labgrid-device-config-images>` containing the path | |
of the bitstream, if not specified when calling `load()` | |
- board (str): optional, the FPGA board identifier | |
- frequency (int): optional, force a non-default programmer frequency in Hz |
doc/configuration.rst
Outdated
@@ -1950,6 +1951,40 @@ Arguments: | |||
- board_config (str): optional, board config in the ``openocd/scripts/board/`` directory | |||
- load_commands (list of str): optional, load commands to use instead of ``init``, ``bootstrap {filename}``, ``shutdown`` | |||
|
|||
OpenFPGALoaderDriver | |||
~~~~~~~~~~~~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title underline too short (see CI error).
~~~~~~~~~~~~~ | |
~~~~~~~~~~~~~~~~~~~~ |
filename = self.target.env.config.get_image_path(self.image) | ||
mf = ManagedFile(filename, self.interface) | ||
mf.sync_to_resource() | ||
cmd += ["--bitstream", mf.get_remote_path() ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd += ["--bitstream", mf.get_remote_path() ] | |
cmd += ["--bitstream", mf.get_remote_path()] |
mf.sync_to_resource() | ||
cmd += ["--bitstream", mf.get_remote_path() ] | ||
|
||
cmd += ["--busdev-num", f"{self.interface.busnum}:{self.interface.devnum}" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd += ["--busdev-num", f"{self.interface.busnum}:{self.interface.devnum}" ] | |
cmd += ["--busdev-num", f"{self.interface.busnum}:{self.interface.devnum}"] |
doc/configuration.rst
Outdated
.. code-block:: yaml | ||
|
||
OpenFPGALoaderDriver: | ||
board: vcu118 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the example consistent:
board: vcu118 | |
board: 'vcu118' |
Otherwise YAML assumes a type, which might fail in funny ways depending on the board identifier.
super().__attrs_post_init__() | ||
|
||
if self.target.env: | ||
self.tool = self.target.env.config.get_tool('openFPGALoader') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a lowercase toos key here and add it to the "Tools Keys" section in man/labgrid-device-config.rst
(and regenerate the man pages).
doc/configuration.rst
Outdated
- https://trabucayre.github.io/openFPGALoader/compatibility/fpga.html | ||
- https://trabucayre.github.io/openFPGALoader/compatibility/board.html | ||
- https://trabucayre.github.io/openFPGALoader/compatibility/cable.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation:
- https://trabucayre.github.io/openFPGALoader/compatibility/fpga.html | |
- https://trabucayre.github.io/openFPGALoader/compatibility/board.html | |
- https://trabucayre.github.io/openFPGALoader/compatibility/cable.html | |
- https://trabucayre.github.io/openFPGALoader/compatibility/fpga.html | |
- https://trabucayre.github.io/openFPGALoader/compatibility/board.html | |
- https://trabucayre.github.io/openFPGALoader/compatibility/cable.html |
- `AlteraUSBBlaster`_ | ||
- NetworkAlteraUSBBlaster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also add this driver to AlteraUSBBlaster's "Used by" section.
Also, please squash/rebase your commit(s). |
A driver interfacing with the openFPGADriver universal FPGA programming tool. Signed-off-by: Maciej Grela <[email protected]>
dbf2772
to
e26fff8
Compare
I fixed the above problems, rebased and squashed everything into a single commit. |
Ping. |
1 similar comment
Ping. |
ping |
A driver interfacing with the openFPGADriver universal FPGA programming tool.
Description
This driver adds support for bootstraping FPGA boards using the openFPGALoader universal FPGA programming utility (https://github.com/trabucayre/openFPGALoader).
OpenFPGALoader supports a large number of FPGA boards, boards and programming cables. It is a useful addition to the openocd support greatly expanding the amount of FPGA hardware that can be worked with using labgrid.
The code has been tested locally on a Xilinx VCU118 board.
There are no tests currently for the driver as it is not clear to me how it could be tested without real HW.
Checklist