Updated to include information for 8.10, 9.10, and 64-bit Linux.
Replace dash with bash:
sudo apt-get install bash ln -sf bash /bin/sh
Install ISE and EDK, and Service Pack 3. When prompted to install the cable drivers, CHOOSE NO. (We're going to install an alternative driver, called the "libusb" driver using the setup_pcusb command described below.) These are the directories I used for installing ISE and EDK:
- /home/xilinx/10.1_sp3/ise
- /home/xilinx/10.1_sp3/edk
Fake out various prerequisites:
# Fake libdb-4.1.so (for 32-bit Linux): sudo apt-get install libdb4.2 sudo ln -s libdb-4.2.so /usr/lib/libdb-4.1.so # NOTE: If you are running 64-bit Linux, try this instead: sudo apt-get install ia32-libs # provides libdb-4.7.so if you're lucky ln -s libdb-4.7.so /usr/lib32/libdb-4.1.so # NOTE: getlibs is a tool for installing 32-bit libs on 64-bit Ubuntu wget http://frozenfox.freehostia.com/cappy/getlibs chmod a+rx getlibs sudo ./getlibs libusb.so # installs 32-bit version libusb-dev for Impact # Fake gmake: sudo ln -s make /usr/bin/gmake # Fake Acrobat Reader (for datasheets in EDK): sudo apt-get install xpdf sudo ln -s xpdf /usr/bin/acroread
Install more prerequisites and helper tools:
sudo apt-get install libstdc++5 sudo apt-get install fxload sudo apt-get install rlwrap # the readline wrapper
Put the following function into .bashrc (or into some other system-wide environment script). Whenever opening a new shell, you must execute this function prior to running any Xilinx programs:
x101sp3 () { local xil_home xil_home=/home/xilinx/10.1_sp3 . $xil_home/chipscope/ChipScope/settings32.sh . $xil_home/ise/ISE/settings32.sh . $xil_home/edk/EDK/settings32.sh export PATH="$xil_home/edk/EDK/gnu/powerpc-eabi/lin/bin:$PATH" export PATH="$xil_home/edk/EDK/gnu/microblaze/lin/bin:$PATH" export XIL_IMPACT_USE_LIBUSB=1 alias inserter='AWT_TOOLKIT=MToolkit inserter.sh' alias analyzer='AWT_TOOLKIT=MToolkit analyzer.sh' }
Install the libusb cable drivers:
# Restart your shell so that you have the "x101sp3" function # (i.e. the one described above) x101sp3 # to get the $XILINX environment variable cd $XILINX/bin/lin sudo su # switch to root # Restart the udevd service, because for some reason multiple udevd # processes sometimes get spawned which confuses setup_pcusb: /etc/init.d/udev restart . setup_pcusb . setup_pcusb # yes, do it again # Fix incorrect/broken rules (they will break in Ubuntu 9.10, but they # worked prior to that): perl -p -i.bak -e 's/BUS.*"03fd".*SYSFS.idProduct.=="(....)".*/SUBSYSTEM=="usb", ACTION=="add", ATTR\{idVendor\}=="03fd", ATTR\{idProduct\}=="\1", RUN+="\/sbin\/fxload -v -t fx2 -I \/usr\/share\/xusbdfwu.hex -D %N"/g' /etc/udev/rules.d/xusbdfwu.rules exit # get out of root
Now you are set. To get access to the Xilinx tools, just run x101sp3 and then you'll be able to run ise, xps, and other commands. Here is an example usage:
x101sp3 # <-- loads up the environment variables # To launch xps or ise or whatever: linux32 xps # To launch impact: # linux32 is only necessary if you are running 64-bit Linux: linux32 impact -batch etc/download.cmd # To launch XMD: rlwrap linux32 xmd -opt etc/xmd_ppc405_0.opt # To launch ChipScope: linux32 inserter.sh linux32 analyzer.sh
Replace dash with bash:
sudo apt-get install bash ln -sf bash /bin/sh
Install ISE and EDK, and Service Pack 3. When prompted to install the cable drivers, CHOOSE NO. (We're going to install an alternative driver, called the "libusb" driver using the setup_pcusb command described below.) These are the directories I used for installing ISE and EDK:
- /home/xilinx/10.1_sp3/ise
- /home/xilinx/10.1_sp3/edk
Fake out various prerequisites:
# Fake libdb-4.1.so (for 32-bit Linux): sudo apt-get install libdb4.2 sudo ln -s libdb-4.2.so /usr/lib/libdb-4.1.so # Fake gmake: sudo ln -s make /usr/bin/gmake # Fake Acrobat Reader (for datasheets in EDK): sudo apt-get install xpdf sudo ln -s xpdf /usr/bin/acroread
Install more prerequisites and helper tools:
sudo apt-get install libstdc++5 sudo apt-get install fxload sudo apt-get install rlwrap # the readline wrapper
Put the following function into .bashrc (or into some other system-wide environment script). Whenever opening a new shell, you must run execute this function prior to running any Xilinx programs:
x101sp3 () { local xil_home xil_home=/home/xilinx/10.1_sp3 . $xil_home/chipscope/ChipScope/settings32.sh . $xil_home/ise/ISE/settings32.sh . $xil_home/edk/EDK/settings32.sh export PATH="$xil_home/edk/EDK/gnu/powerpc-eabi/lin/bin:$PATH" export PATH="$xil_home/edk/EDK/gnu/microblaze/lin/bin:$PATH" export XIL_IMPACT_USE_LIBUSB=1 alias inserter='AWT_TOOLKIT=MToolkit inserter.sh' alias analyzer='AWT_TOOLKIT=MToolkit analyzer.sh' }
Install the libusb cable drivers:
# Restart your shell so that you have the "x101sp3" function # (i.e. the one described above) x101sp3 # to get the $XILINX environment variable cd $XILINX/bin/lin sudo su # switch to root . setup_pcusb . setup_pcusb # yes, do it again exit # get out of root
Now you are set. To get access to the Xilinx tools, just run x101sp3 and then you'll be able to run ise, xps, and other commands. Here is an example usage:
x101sp3 # <-- loads up the environment variables # To launch xps or ise or whatever: xps # To launch impact: impact -batch etc/download.cmd # To launch XMD: rlwrap xmd -opt etc/xmd_ppc405_0.opt # To launch ChipScope: inserter.sh analyzer.sh
When trying to run impact on a 64-bit machine, you may encounter this problem:
impact -batch etc/download.cmd Release 10.1.03 - iMPACT K.39 (lin) Copyright (c) 1995-2008 Xilinx, Inc. All rights reserved. Preference Table Name Setting StartupClock Auto_Correction AutoSignature False KeepSVF False ConcurrentMode False UseHighz False ConfigOnFailure Stop UserLevel Novice MessageLevel Detailed svfUseTime false SpiByteSwap Auto_Correction AutoDetecting cable. Please wait. OS platform = x86_64. Cable operation is not supported when running the 32-bit version of the application on a 64-bit platform.
SOLUTION: Use getlibs (described in previous section) to install 32-bit libusb-dev. Then launch impact using linux32.
VERIFICATION: Start impact like this (don't forget to put linux32 in front!):
linux32 impact -batch etc/download.cmd Release 10.1.03 - iMPACT K.39 (lin) Copyright (c) 1995-2008 Xilinx, Inc. All rights reserved. ... OS platform = i686. Using libusb. Connecting to cable (Usb Port - USB21). Checking cable driver. File version of /home/xilinx/student_10.1_sp3/ise/ISE/bin/lin/xusbdfwu.hex = 1030. File version of /etc/hotplug/usb/xusbdfwu.fw/xusbdfwu.hex = 1030. Using libusb. Max current requested during enumeration is 150 mA. Type = 0x0605. Cable Type = 3, Revision = 0. Setting cable speed to 6 MHz. Cable connection established. Firmware version = 1100. File version of /home/xilinx/student_10.1_sp3/ise/ISE/data/xusbdfwu.hex = 1100. Firmware hex file version = 1100. PLD file version = 0012h. PLD version = 0012h. Identifying chain contents ....'1': : Manufacturer's ID =Xilinx xc2vp30, Version : 1 ---------------------------------------------------------------------- ---------------------------------------------------------------------- '2': : Manufacturer's ID =Xilinx xccace, Version : 0 ---------------------------------------------------------------------- ---------------------------------------------------------------------- '3': : Manufacturer's ID =Xilinx xcf32p, Version : 15 ---------------------------------------------------------------------- ---------------------------------------------------------------------- done.
Xilinx installer creates incorrect udev file:
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/492018 Udev fails to load correct Xilinx firmware
http://ubuntuforums.org/showthread.php?t=1307574 How does USB work | Xilinx Spartan 3E driver problem
SOLUTION: The rules in /etc/udev/rules.d/xusbdfwu.rules should be rewritten from:
# THIS IS WRONG!!!! # version 0003 SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0008", MODE="666" BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $TEMPNODE" BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xup.hex -D $TEMPNODE" BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_emb.hex -D $TEMPNODE" BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xlp.hex -D $TEMPNODE" BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0013", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $TEMPNODE" BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0015", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xse.hex -D $TEMPNODE"
to this:
# THIS IS CORRECT :-) (I hope) SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0008", MODE="666" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D %N" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D %N" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D %N" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D %N" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0013", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D %N" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0015", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D %N"
(or as a simpler fix, you can replace $TEMPNODE with $tempnode). To quickly fix this, run this command:
perl -p -i.bak -e 's/BUS.*"03fd".*SYSFS.idProduct.=="(....)".*/SUBSYSTEM=="usb", ACTION=="add", ATTR\{idVendor\}=="03fd", ATTR\{idProduct\}=="\1", RUN+="\/sbin\/fxload -v -t fx2 -I \/usr\/share\/xusbdfwu.hex -D %N"/g' /etc/udev/rules.d/xusbdfwu.rules
VERIFICATION: When you plug in your device, fxload should run and cause a re-enumeration. You can check if this has occurred by running lsusb and checking that the vendor/device ID is 03fd:0008. Here is an example:
lsusb Bus 005 Device 011: ID 03fd:0009 Xilinx, Inc. # <-- BAD! Bus 005 Device 055: ID 03fd:0008 Xilinx, Inc. # <-- GOOD!