Xilinx USB JTAG Programming

Introduction

This page describes xup, a GNU GPL utility for programming Xilinx FPGA/CPLD/PROM devices via Xilinx's USB JTAG programmer. There are several reasons to use xup instead of Xilinx's proprietary software, especially when running Linux.

News

2006-11-15: Added shell command to allow use as non-root (see FAQ).
2006-08-19: xup-0.0.2 - CPLD updated to fix possible electrical contention with iMPACT. Upgrade highly recommended.
2006-05-28: xup-0.0.1 - initial release.

Hardware

The Spartan3E Starter Kit is xup's only supported hardware platform. Its integrated programming hardware consists of a cy7c68013a-100axc EZ-USB and a XC2C256-VQ100-6C CPLD.

Mysteriously, the starter kit's schematics exclude this USB programming hardware. The programmer's electrical connectivity was reverse engineered to implement xup.

The standalone Xilinx Platform Cable USB is unsupported and untested. Since its hardware is presumably very similar, it may be usable as-is or with some minor hacking.

CY7C68013A EZ-USB

The EZ-USB contains an 8051 microcontroller. The firmware used with iMPACT is proprietary, and is therefore not used with xup. A replacement firmware has been written in C, allowing the USB host to bit-bang the XC2C256's JTAG port, as well as the system JTAG port connnected to the Starter Kit's XC3S500E FPGA, XCF04S PROM, and XC2C64 CPLD.

xup does not modify the I2C EEPROM containing the programmer's USB ID (and possibly iMPACT firmware). The xup utilities reload the EZ-USB firmware over USB at startup.

XC2C256

The CPLD image used with iMPACT is proprietary, and is therefore not used with xup. A simple replacement CPLD image has been created to connect several EZ-USB I/Os to the system's JTAG signals. Prior to accessing the system's JTAG, this CPLD image must first be downloaded using XSVF JTAG playback.

XSVF Playback

The XSVF Playback software from XAPP058 has been modified to work with xup's EZ-USB firmware. This XSVF player is used to download xup's XC2C256 CPLD image, and can also be used to program devices on the system JTAG chain.

XC3SProg

Andrew Roger's xc3sprog has been modified to work with xup's firmware + CPLD. This modified version can program the Starter Kit's XC3S500E FPGA directly from a .bit file.

Security

libusb is used for all USB device access. As a result, no kernel modules are required on the development workstation. Furthermore, root access is not required. Under Linux, the user must merely have access to the appropriate /proc/bus/usb/BUS/DEV file (typically granted by chown'ing it). The BUS and DEV numbers in the filename can be extracted from lsusb's output -- see FAQ item below.

FAQ

Q: Will xup lock out the Xilinx tools forever, or can iMPACT successfully reconfigure the JTAG hardware to replace xup?
A: iMPACT will simply redownload its EZ-USB + CPLD images over xup's, as if it were upgrading older iMPACT firmware. To switch back to xup, redownload the xup CPLD image via XSVF. The use of different CPLD images is unavoidable unless Xilinx documents the iMPACT CPLD (or it is reversed).

Q: Will xup's xc3sprog detect that the proper CPLD was programmed?
A: Not yet. CPLD detection may be added in a future release. Do NOT run xup's xc3sprog unless the xup CPLD download succeeded. Also, do NOT mix CPLD and firmware versions from different versions of xup.

Q: Is USB1 supported?
A: USB1 is untested but may work. If you are having problems with USB1 please try USB2.

Q: AMD64/PPC32/PPC64? BSD?
A: Currently untested but should work w/ minor hacking.

Q: How do I run xup as a non-root user under Linux?
A: As root, first run:

chown user:user /proc/bus/usb/`lsusb | grep "Xilinx" | cut -b 5-7`/`lsusb | grep "Xilinx" | cut -b 16-18`

Future Work

Downloading the XC3S500E via xup takes about 8 seconds, making xup about 4X slower than iMPACT (once started). The load time is a small price to pay for dodging a proprietary nightmare. And there are many ways to improve xup's speed. For now, though, they are left as an exercise for the ambitious reader.

The programmer's EZ-USB and XC2C256 are barely utilized with xup, and could implement a lot of added functionality. One option is to connect the Starter Kit FPGA to USB2 by wiring a few FPGA user I/Os to the EZ-USB and/or CPLD.

Download

xup-0.0.2.tar.gz

HOWTO

With Debian Sid:

apt-get install libusb-dev
apt-get install sdcc
tar zxvf xup-0.0.2.tar.gz
cd xup-0.0.2
make
# download xup's pre-built programmer CPLD image
# this will take 5-30 minutes
# you only need to do this when installing/upgrading xup,
# or switching between iMPACT and xup
./p -v 4 prog.xsvf
# now build xup's XC3SProg
cd XC3SProg
make
./xc3sprog /some/file.bit
cp -a xc3sprog /usr/local/bin

Links

xc3sprog
fx2_programmer
Small Device C Compiler

Contact

bryanr at inisyn dot org

Legal

copyright (c) 2006 inisyn research

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Keep a fire extinguisher near by.