-
Notifications
You must be signed in to change notification settings - Fork 2
Program 7 Series FPGA from a Mac or Linux Without Xilinx
nelsobe edited this page Jan 20, 2021
·
17 revisions
Thanks to Andy Wilson for providing a number of the details required to do this.
- This assumes you know how to use your Mac beyond the GUI mode of clicking icons. You may need to learn about using the terminal application for typing commands to the operating system before you start (see next bullet).
- This assumes you know about the Mac terminal (which is built in). It is an application in the "Utilities" section of your "Applications" area. It will provide an interactive terminal you can type commands into.
- If you don't have brew on your mac already you will you will need to install it. Brew is a package manager which simplifies installing outside packages on your Mac. If you don't have it, the webpage
brew.sh
has a good introduction on how to add brew to your machine. It is a one-liner to install. You type the commands they give in the above webpage into a terminal window. - Once you have brew on your Mac, do:
brew install openocd
to install openocd (you type that command into the Mac terminal prompt as well).
If on Linux you only need to do: sudo apt install openocd
(which you type into a shell window).
Put the following into a file in the directory you want to be working in. Call the file 7series.txt
.
# File: 7series.txt
interface ftdi
ftdi_device_desc "Digilent USB Device"
ftdi_vid_pid 0x0403 0x6010
# channel 1 does not have any functionality
ftdi_channel 0
# just TCK TDI TDO TMS, no reset
ftdi_layout_init 0x0088 0x008b
reset_config none
adapter_khz 10000
source [find cpld/xilinx-xc7.cfg]
source [find cpld/jtagspi.cfg]
init
puts [irscan xc7.tap 0x09]
puts [drscan xc7.tap 32 0]
puts "Programming FPGA..."
pld load 0 stopwatch_top.bit
exit
- First, you will need a bitfile.
- Change the bitfile name at the bottom of the .txt file to match your bitfile name you wrote in the step above.
- Run
openocd -f 7series.txt
. If the "Done" LED on the board goes on, it worked. If not, it didn't. However, even ifthe bitfile didn't program correctly, the feedback from
This will work with parts that use the same JTAG setup as these boards but not necessarily for others. For example, it has been tested on an Arty board, a Basys3 board, and a NEXYS4 DDR board. It will not work with a Pynq board due to a different setup.
Rather than have to hard code the name of your bitfile into the 7series.txt file, you can use an environment variable to point to the bitfile.
- Put this into your directory:
# File: 7series.txt
interface ftdi
ftdi_device_desc "Digilent USB Device"
ftdi_vid_pid 0x0403 0x6010
# channel 1 does not have any functionality
ftdi_channel 0
# just TCK TDI TDO TMS, no reset
ftdi_layout_init 0x0088 0x008b
reset_config none
adapter_khz 10000
source [find cpld/xilinx-xc7.cfg]
source [find cpld/jtagspi.cfg]
init
puts [irscan xc7.tap 0x09]
puts [drscan xc7.tap 32 0]
puts "Programming FPGA..."
pld load 0 ${::env(BITSTREAM)}
exit
- Now, set the environment variable called
BITSTREAM
to be the name of your .bit file:
export BITSTREAM=stopwatch_top.bit
- Program the board as above.