Xilinx notes¶
To simplify further explanations, we consider the project is generated in the current directory.
Note
Spartan Edge Accelerator Board has only pinheader, so the cable must be provided
A JTAG <-> SPI bridge (used to write bitstream in FLASH) is available for some device, see spiOverJtag to check if your model is supported.
Board provides the device/package model, but if the targeted board is not officially supported but the FPGA yes, you can use
--fpga-part
to provide the model.With spartan3, the flash is an independent JTAG device. User has to use
--index-chain
to access FPGA (RAM only) or flash (write/read only).
Warning
*.bin
may be loaded in memory or in flash, but this extension is a classic extension for CPU firmware and, by
default, openFPGALoader loads file in memory.
Double check -m
/ -f
when you want to use a firmware for a softcore (or anything, other than a bitstream) to
write somewhere in the FLASH device).
.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]
.
Warning
For alchitry board the bitstream must be configured with a buswidth of 1 or 2. Quad mode can’t be used with alchitry’s FLASH.
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¶
Note
.bit
, .bin
, and .mcs
are supported for 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
Note
-interface spix4
and -size 16
depends on SPI flash capability and size.
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)
Note
-f
is required to write bitstream (without them .bit
and .bin
are loaded in memory).
Note
--fpga-part
is only required if this information is not provided at board.hpp
level or if the board is not
officially supported.
device/package format is something like xc7a35tcsg324 (arty model).
See src/board.hpp, or spiOverJtag directory for examples.