vendor.xilinx_7series: byte swap generated bitstream
authorNorbert Braun <norbert@xrpbot.org>
Mon, 2 Nov 2020 21:00:17 +0000 (22:00 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 31 Dec 2021 15:19:14 +0000 (15:19 +0000)
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.

nmigen/vendor/xilinx_7series.py

index 136ab18222cb20520dec1bad56fb8545239eb385..9dd738c57f21c4cff1ea1cc8b5383cdf4c6f83e2 100644 (file)
@@ -143,7 +143,8 @@ class Xilinx7SeriesPlatform(TemplatedPlatform):
             report_timing_summary -datasheet -max_paths 10 -file {{name}}_timing.rpt
             report_power -file {{name}}_power.rpt
             {{get_override("script_before_bitstream")|default("# (script_before_bitstream placeholder)")}}
-            write_bitstream -force -bin_file {{name}}.bit
+            write_bitstream -force {{name}}.bit
+            write_cfgmem -force -format bin -interface smapx32 -disablebitswap -loadbit "up 0 {{name}}.bit" {{name}}.bin
             {{get_override("script_after_bitstream")|default("# (script_after_bitstream placeholder)")}}
             quit
         """,