Xilinx notes¶
To simplify further explanations, we consider the project is generated in the current directory.
.bit file is the default format generated by vivado, so nothing special task must be done to generate this bitstream.
.bin is not, by default, produced. To have access to this file you need to configure the tool:
- GUI: Tools -> Settings -> Bitstreams -> check
-bin_file. - TCL: append your TCL file with
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1].
Loading a bitstream¶
.bit and .bin are allowed to be loaded in memory.
File load:
openFPGALoader [-m] -b arty *.runs/impl_1/*.bit (or *.bin)
or
openFPGALoader [-m] -b spartanEdgeAccelBoard -c digilent_hs2 *.runs/impl_1/*.bit (or *.bin)
SPI flash¶
.mcs must be generated through Vivado with a tcl script like:
set project [lindex $argv 0]
set bitfile "${project}.runs/impl_1/${project}.bit"
set mcsfile "${project}.runs/impl_1/${project}.mcs"
write_cfgmem -format mcs -interface spix4 -size 16 \
-loadbit "up 0x0 $bitfile" -loaddata "" \
-file $mcsfile -force
The tcl script is used with:
vivado -nolog -nojournal -mode batch -source script.tcl -tclargs myproject
File load:
openFPGALoader [--fpga-part xxxx] -f -b arty *.runs/impl_1/*.mcs (or .bit / .bin)
Some boards with UltraScale FPGAs, like the VCU118 and KCU16, support the SPIx8 (Dual Quad SPI) configuration. In this case, the spix8 option write_cfgmem on the above example can be used to generate two .mcs files, to fit bigger designs or for faster programming. Only .mcs files can be used to program the FPGA in this case.
In this case, to load the two .mcs files:
openFPGALoader --board vcu118 -f --target-flash both --bitstream *.runs/impl_1/*_primary.mcs --secondary-bitstream *.runs/impl_1/*_secondary.mcs
On these boards, each SPI flash can be programmed independently with the --target-flash option. The default target is the primary flash.
For example, to program only the secondary flash with arbitrary data not related to FPGA configuration:
openFPGALoader --board vcu118 -f --target-flash secondary --bitstream arbitrary_data