Closed rachsug closed 2 years ago
I think the issue is that toolchain_prepare
unconditionally adds write_cfgmem
to script_after_bitstream
.
Two possible fixes that come to mind:
write_cfgmem
command from toolchain_program
.do_program
through to toolchain_prepare
so that it can conditionally add write_cfgmem
.The first option seems conceptually a bit nicer to me, but would mean writing and running a second .tcl file, so might be more work.
afaik, write_cfgmem
isn't trying to write anything to the device but instead to write a file suitable for programming into config memory. The real problem here is why the write_cfgmem
args don't match the configuration elsewhere.
This bug is introduced in https://github.com/nmigen/nmigen/pull/523.
@nfbraun Could you please explain the meaning of -interface smapx32
in this context?
It is needed to change the endianness of every 4 byte group with respect to what write_bitstream -bin_file
(or write_cfgmem
without the -interface
option) would produce. (Basically, it turns aa 99 55 66
into 66 55 99 aa
.) For whatever reason, mainline FPGA Manager insists on that format (for Zynq), and I have not found any other way to produce this from within Vivado.
@nfbraun Do you have any insight on fixing this bug? I'm not familiar with Xilinx's deployment tools.
I guess FPGA Manager is not normally involved in programming non-Zynq 7 Series FPGAs, so maybe restore the old behavior for non-Zynqs?
Hm. I guess we could make the write_cfgmem
arguments an override that the Zyng boards provide in toolchain_prepare
.
Either that, or just put the whole write_cfgmem
command into the existing script_after_bitstream
override.
Either that, or just put the whole
write_cfgmem
command into the existingscript_after_bitstream
override.
That would break all existing board definitions, no? Since script_after_bitstream
is empty by default and should stay so.
As far as I can see, the board definitions for various Artix-7 boards (e.g. https://github.com/nmigen/nmigen-boards/blob/master/nmigen_boards/arty_a7.py) already have a write_cfgmem
command (with different paramters) in their script_after_bitstream
override, but none of the Zynq boards do.
So I guess I added the write_cfgmem
command in a place that is too generic and the Zynq boards should instead follow what the Artix-7 boards do?
I would suggest to revert #523. I have opened a PR in nmigen-boards for a ZedBoard config that fixes #519 (for the ZedBoard) without affecting other devices: https://github.com/nmigen/nmigen-boards/pull/135. The board configs for other Zynq boards would have to add something similar.
@rachsug: Can you confirm that reverting commit 14a5c42
fixes the problem?
I strongly suspect there will come a case where our default write_cfgmem
will break things, so I think this should be a new override (that defaults to the pre-#523 behavior).
Yep, @rachsug and I both locally reverted that commit and it did indeed fix the problem. Thanks
@whitequark: not sure if I understand correctly... AFAIK, there was no write_cfgmem
before #523. It generated the .bin file via the -bin_file
option to write_bitstream
. Do you propose to make that configurable? I don't think it matters, because a write_cfgmem
command introduced via the board config can always just overwrite the .bin file. Or am I missing something?
@nfbraun You're right; I misunderstood. I reverted #523.
I believe this is no longer an issue after reverting #523. Please comment if there is anything that still needs to be done here.
Trying to generate a bitstream from nmigen for the arty board. The output finishes with this error:
Seems to try to write to arty board when it has not been coded to. Here is the code that produces this error: