-
Notifications
You must be signed in to change notification settings - Fork 178
Xilinx Zynq: generated bitstreams do not work with (recent?) FPGA Manager #519
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
Comments
Your solution seems good to me. |
nfbraun
added a commit
to nfbraun/nmigen
that referenced
this issue
Nov 2, 2020
The Zynq driver in the FPGA Manager framework on Linux expects bitstreams that are byte swapped with respect to what the Vivado command `write_bitstream -bin_file` produces. Thus, use the `write_cfgmem` command with appropriate options to generate the bitstream (.bin file). Fixes amaranth-lang#519.
nfbraun
added a commit
to nfbraun/nmigen
that referenced
this issue
Nov 2, 2020
The Zynq driver in the FPGA Manager framework on Linux expects bitstreams that are byte swapped with respect to what the Vivado command `write_bitstream -bin_file` produces. Thus, use the `write_cfgmem` command with appropriate options to generate the bitstream (.bin file). Fixes amaranth-lang#519.
whitequark
pushed a commit
that referenced
this issue
Nov 3, 2020
The Zynq driver in the FPGA Manager framework on Linux expects bitstreams that are byte swapped with respect to what the Vivado command `write_bitstream -bin_file` produces. Thus, use the `write_cfgmem` command with appropriate options to generate the bitstream (.bin file). Fixes #519.
when i write "cat /root/{{name}}.bin > /dev/xdevcfg nothing happens to the output or terminal and "echo {{name}}.bin > /sys/class/fpga_manager/fpga0/firmware" gives invalid argument |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Xilinx Zynq, the task of loading bitstreams into the programmable logic part
of the device is typically handled by the Linux kernel, via the FPGA Manager
framework.
The bitstreams that nMigen generates (via Vivado) fail to load through FPGA
Manager, with an error message like this:
As the error message says, that is due to the fact that FPGA Manager
expects a byte swapped .bin file, but the file produced by Vivados
write_bitstream -bin_file
command is not byte swapped. The (obsolete) xdevcfginterface in ancient Xilinx kernels seems to have detected this (via the sync
word) and corrected it if required, but this feature does not seem to have made
it into FPGA Manager. (See https://lore.kernel.org/patchwork/patch/605909/ for
the discussion.)
There is a tool called
fpga-bit-to-bin.py
floating around on the Internetthat people use to generate the correct .bin files; however, it can also be
done directly from Vivado.
My suggested fix would be to not generate the .bin file via the
-bin_file
option to
write_bitstream
(innmigen/vendor/xilinx_7series.py
), but insteadissue a separate command to generate it,
This would give a .bin file that works with FPGA Manager.
If there are uses that require a non byte swapped .bin file, one could also
generate two different .bin files, but I don't think that is required (the
xdevcfg interface works with both variants).
If this solution is deemed acceptable, I can submit a PR.
The text was updated successfully, but these errors were encountered: