Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
electronics:fpga:freebsd_xilinx [2010/02/05 23:41] – Bring some updates and add one successful contributor WojciechKoszekelectronics:fpga:freebsd_xilinx [2022/10/03 07:59] (current) – Remove name/email from opening, add HomePage link in intro KubilayKocak
Line 1: Line 1:
 ====== Working with Xilinx FPGAs on FreeBSD ====== ====== Working with Xilinx FPGAs on FreeBSD ======
-//Wojciech A. Koszek// \\  
-''%%wkoszek@FreeBSD.org%%'' \\  
-''%%http://FreeBSD.czest.pl/~wkoszek/%%'' \\  
  
 This page documents steps necessary to get Xilinx ISE 11.1 This page documents steps necessary to get Xilinx ISE 11.1
-IDE running on %%FreeBSD%% 9 system. Please contact the author+IDE running on %%FreeBSD%% 9 system. Please contact [[/WojciechKoszek|WojciechKoszek]]
 if information found here didn't let you to get Xilinx FPGA if information found here didn't let you to get Xilinx FPGA
 toolkit working, are inappropriate or obsolete. toolkit working, are inappropriate or obsolete.
 +
 +Note that the newer Xilinx Vivado Design Suite uses Java, including the xsetup installer.
 +Unfortunately I ([[/RebeccaCran|RebeccaCran]]) haven't been able to get it to work on %%FreeBSD%% 11.1 since java (%%OpenJRE%% 8) segfaults as the installer starts.
  
 ===== Introduction to free Xilinx ISE environment ===== ===== Introduction to free Xilinx ISE environment =====
  
-ISE [[/WebPack|WebPack]] is a free variant of ISE Design Suite supporting+ISE %%WebPack%% is a free variant of ISE Design Suite supporting
 most popular FPGA chips manufactured by Xilinx. This version most popular FPGA chips manufactured by Xilinx. This version
 should be enough for you in most of the cases and its use will should be enough for you in most of the cases and its use will
Line 74: Line 74:
 running next to me. Apart from X11 and %%ViM%%, nothing has been installed. running next to me. Apart from X11 and %%ViM%%, nothing has been installed.
 Installer and command-line utilities as well as "ise" -- graphical frontend Installer and command-line utilities as well as "ise" -- graphical frontend
-require couple of packages installed:+require couple of ports installed: 
 + 
 +<code> 
 +(cd /usr/ports/emulators/linux_base-f10 && make install) 
 +(cd /usr/ports/textproc/linux-f10-expat && make install) 
 +(cd /usr/ports/x11-fonts/linux-f10-fontconfig && make install) 
 +(cd /usr/ports/graphics/linux-f10-png && make install) 
 +(cd /usr/ports/x11/linux-f10-xorg-libs && make install) 
 +</code> 
 + 
 +After installation, this is how ''%%/var/db/pkg%%'' look like:
  
 <code> <code>
Line 86: Line 96:
  
 You can see full list of packages installed at a time of writing this tutorial here You can see full list of packages installed at a time of writing this tutorial here
-(while most of ports has been installed as a part of [[/ImageMagic|ImageMagic]] installation, so+(while most of ports has been installed as a part of %%ImageMagic%% installation, so
 that obtaining screenshots could be possible): that obtaining screenshots could be possible):
  
Line 105: Line 115:
 ===== Obtaining Xilinx ISE environment ===== ===== Obtaining Xilinx ISE environment =====
  
-In order to obtain Xilinx ISE [[/WebPack|WebPack]], you must visit this site:+In order to obtain Xilinx ISE %%WebPack%%, you must visit this site:
  
-[[http://www.xilinx.com/tools/webpack.htm]]+[[http://www.xilinx.com/tools/!WebPack.htm]]
  
 In order to proceed, one needs to have an account on the Xilinx In order to proceed, one needs to have an account on the Xilinx
 page. After successful account creation, you have to log in and page. After successful account creation, you have to log in and
-download [[/WebPack|WebPack]] package. Successful process should result in+download %%WebPack%% package. Successful process should result in
 having ''%%.tar%%'' file on your disk: having ''%%.tar%%'' file on your disk:
  
 <code> <code>
-wkoszek@laptop:/media/Multimedia$ ls Xilinx_11.1_WebPack_SFD.tar +wkoszek@laptop:/media/Multimedia$ ls Xilinx_11.1_!WebPack_SFD.tar 
--rw-r--r--  1 wkoszek  wkoszek  2868316160  5 paź 17:04 Xilinx_11.1_WebPack_SFD.tar+-rw-r--r--  1 wkoszek  wkoszek  2868316160  5 paź 17:04 Xilinx_11.1_!WebPack_SFD.tar
  
 </code> </code>
Line 127: Line 137:
  
 <code> <code>
-# md5 /home/wkoszek/Xilinx_11.1_WebPack_SFD.tar  +# md5 /home/wkoszek/Xilinx_11.1_!WebPack_SFD.tar  
-MD5 (/home/wkoszek/Xilinx_11.1_WebPack_SFD.tar) = 42ce70bd3f78e68295175db2441c8b3a +MD5 (/home/wkoszek/Xilinx_11.1_!WebPack_SFD.tar) = 42ce70bd3f78e68295175db2441c8b3a 
-# sha1 /home/wkoszek/Xilinx_11.1_WebPack_SFD.tar +# sha1 /home/wkoszek/Xilinx_11.1_!WebPack_SFD.tar 
-SHA1 (/home/wkoszek/Xilinx_11.1_WebPack_SFD.tar) =2b57b4fb00914e50d1b0a4d0a49e511ca56e85fb+SHA1 (/home/wkoszek/Xilinx_11.1_!WebPack_SFD.tar) =2b57b4fb00914e50d1b0a4d0a49e511ca56e85fb
  
 </code> </code>
Line 144: Line 154:
  
 <code> <code>
-# tar xf Xilinx_11.1_WebPack_SFD.tar +# tar xf Xilinx_11.1_!WebPack_SFD.tar 
-# cd Xilinx_11.1_WebPack_SFD+# cd Xilinx_11.1_!WebPack_SFD
 </code> </code>
  
Line 181: Line 191:
 In order to let you to work with Xilinx command line tools, you can use preprepared In order to let you to work with Xilinx command line tools, you can use preprepared
 shell scripts ''%%settings32.csh%%'' (for CSH) and ''%%settings32.sh%%'' (for sh-alike shells) shell scripts ''%%settings32.csh%%'' (for CSH) and ''%%settings32.sh%%'' (for sh-alike shells)
-living in ''%%/compat/linux/opt/Xilinx/11.1%%''. I've put:+living in ''%%/compat/linux/opt/Xilinx/11.1%%''. You need to modify a path stating where 
 +to find the tools from: 
 + 
 +<code> 
 +set INSTALL_LOC="/opt/Xilinx/11.1" 
 +</code> 
 + 
 +to 
 + 
 +<code> 
 +set INSTALL_LOC="/compat/linux/opt/Xilinx/11.1/" 
 +</code> 
 + 
 +I've put:
  
 <code> <code>
Line 208: Line 231:
 a bitstream targeted against Spartan 3e500 (fg320 variant) and you stream a bitstream targeted against Spartan 3e500 (fg320 variant) and you stream
 it through the programming application, that deals with USB communication. it through the programming application, that deals with USB communication.
- 
 //Option B will be documented in the future// //Option B will be documented in the future//
  
-==== Programming Xilinx FPGAs: background ====+Anyway, in order to start programming, you have to prepare your JTAG 
 +cable.. 
 + 
 +==== Xilinx FPGA programming tools: background ====
  
 Xilinx based its programming functionality on FX2 chip (also known as EZ-USB), Xilinx based its programming functionality on FX2 chip (also known as EZ-USB),
Line 219: Line 244:
 to program microcontroller. Once done, it detaches from the USB bus and to program microcontroller. Once done, it detaches from the USB bus and
 attaches back as a different, 'target' device. Together with modularity, attaches back as a different, 'target' device. Together with modularity,
-some problems exist. You have to have a software dealing with reenumeration..+some problems exist. You have to have a software for uploading firmware 
 +to the chip.
  
-Even though BSD native tools existed (''%%misc/eztools%%''), they didn't survive +I brought a support for ''%%libusb%%'' to the latest version of fxload(8) tool. 
-"New USB" convertion. However, there exists ''%%fxload%%'' for Windows that +Testing confirmed that I can program it on GNU/Linux and %%FreeBSD%% after 
-deploys ''%%libusb%%'': http://wiki.epfl.ch/cfavi/fxload-libusb. It can be trivially +my changes. Here's a Git command that will let you to synchronize with 
-changed and compiled without problems on %%FreeBSD%%. **commit to ports/...**+a code: 
 + 
 +<code> 
 + 
 +git clone http://freebsd.czest.pl/~wkoszek/fpga/fxload-multios.git 
 + 
 +</code> 
 + 
 +You must have ''%%gmake%%'' on your system to build it -- it's pretty straight 
 +forward: 
 + 
 +<code> 
 +gmake 
 +</code> 
 + 
 +It should compile cleanly on %%FreeBSD%% 8/9. Mail me otherwise. 
 +Once you have ''%%fxload(8)%%'' working, you can reprogram your FX2 chip with 
 +correct firmware. File: 
 + 
 +<code> 
 +/compat/linux/opt/Xilinx/11.1/ISE/bin/lin/xusbdfwu.rules 
 +</code> 
 + 
 +Has enough information for particular cases. You simply look at ''%%usbconfig%%'' 
 +output: 
 + 
 +<code> 
 +wkoszek@laptop:/compat/linux/opt/Xilinx/11.1/ISE/bin/lin# usbconfig  
 +ugen0.1: <OHCI root HUB nVidia> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON 
 +ugen1.1: <EHCI root HUB nVidia> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON 
 +ugen1.2: <USB2.0 Syntek> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON 
 +ugen0.2: <Optical USB Mouse Logitech> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON 
 +ugen1.3: <product 0x000d vendor 0x03fd> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON 
 +</code> 
 + 
 +As you see, the last line has something in common with following line from 
 +''%%xusbdfwu.rules%%'': 
 + 
 +<code> 
 +BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_emb.hex -D $TEMPNODE" 
 +</code> 
 + 
 +Finally, we craft a set of command line options: 
 + 
 +<code> 
 +./fxload -v -t fx2 -I /compat/linux/opt/Xilinx/11.1/ISE/bin/lin/xusb_emb.hex -D vid=0x03fd,pid=0x000d 
 +</code> 
 + 
 +After successful programming, you should see that USB device detached and that 
 +different device should reappear as: 
 + 
 +<code> 
 +ugen1.3: <XILINX XILINX> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON         
 +</code>
  
-Once you have ''%%fxload%%'' working, you have to reprogram the chip to serve +If you want to check ''%%fxload%%'' out but you don't have Xilinx ISE installed 
-a correct function. It can be done with:+yet, you have sample firmware for Spartan 3e Starter Kit here:
  
 <code> <code>
-.....command.... <file.hex>+http://freebsd.czest.pl/~wkoszek/fpga/xusb_emb.hex
 </code> </code>
  
-''%%file.hex%%'' will vary, based on a programming method you choose. For Impact, +Green LED should blink first and get permanently turned on after 
-you'll have to pick the firmware provided by Xilinx. For non-proprietary +that. If something else happens, mail me. LED is basically a sign 
-programming software, you may need to provide non-proprietary firmware +of correct programming.
-as well.+
  
-==== Programming from Impact ====+==== Programming from Impact (2010-02-x, WIP: skip for now, please) ====
  
 Starting from 9.2i Alpha release, Xilinx ISE brings native userspace, Starting from 9.2i Alpha release, Xilinx ISE brings native userspace,
Line 265: Line 343:
   * [2] Andrew Rogers' work has been extended by "Inisyn Research" by bringing libUSB support. Project is called XUP: http://inisyn.org/src/xup/. It works (needs some hacks for %%FreeBSD%%).   * [2] Andrew Rogers' work has been extended by "Inisyn Research" by bringing libUSB support. Project is called XUP: http://inisyn.org/src/xup/. It works (needs some hacks for %%FreeBSD%%).
  
-  * [3] Above projects has been consolidated into one big program by Uwe Bonnes. The project is hosted on [[/SourceForge|SourceForge]]: http://sourceforge.net/projects/xc3sprog/ Compiles and works under %%FreeBSD%%.+  * [3] Above projects has been consolidated into one big program by Uwe Bonnes. The project is hosted on %%SourceForge%%: http://sourceforge.net/projects/xc3sprog/ Compiles and works under %%FreeBSD%%. 
 + 
 +**WARNING: as you see, name "xc3sprog" has been reused number of times; below, "xc3sprog" only** 
 +**refers to the [3] project by Uwe Bonnes. The other two aren't supported, as I believe no further** 
 +**development happens there.** 
 + 
 +So, in order to have ''%%xc3sprog%%'', the best way is to obtain the fresh copy straight from the 
 +Subversion: 
 + 
 +<code> 
 +svn co https://xc3sprog.svn.sourceforge.net/svnroot/xc3sprog xc3sprog 
 +</code> 
 + 
 +And build it: 
 + 
 +<code> 
 +cd xc3sprog/trunk 
 +mkdir build ; cd build ; cmake .. ; gmake 
 +</code> 
 + 
 +=== Quick start with xc3sprog === 
 + 
 +Default behavior of ''%%xc3sprog%%'' is to use parallel cable 
 +and perform JTAG scan. 
 + 
 +**Report to Uwe that it's actually wrong nowadays** 
 + 
 +Anyway, for Xilinx cables, you can do a JTAG boundary scan 
 +with: 
 + 
 +<code> 
 +./xc3sprog -c xpc 
 +</code> 
 + 
 +Programming: 
 + 
 +<code> 
 +./xc3sprog -c xpc <file.bit> 
 +</code> 
 + 
 +For those without Xilinx ISE yet, but willing to test whether everything 
 +works, I have provided sample bitstream for Spartan 3E Starter Kit implementing 
 +LED ruler 
 + 
 +<code> 
 +http://freebsd.czest.pl/~wkoszek/fpga/leds.bit 
 +</code> 
 + 
 +Checksums, just in case: 
 + 
 +  * MD5: 1b58146048ede072c9bca9815587974f 
 +  * SHA1: c675f524ade7bc729772b4850274a10192f95b23 
 + 
 +Let me know if something doesn't work for you! I'd like you 
 +to explicitly agree to put your name in a "Success stories".
  
 ==== Success stories ==== ==== Success stories ====
 +
 Programmers: Programmers:
 +
   * PCIII -- parallel cable III   * PCIII -- parallel cable III
 +  * XUSB_EMB -- Startan 3E Starter Kit embedded USB JTAG cable
  
 ^ Board ^ Cable ^ Program ^ Command line ^ Contributor ^ Additional notes ^ ^ Board ^ Cable ^ Program ^ Command line ^ Contributor ^ Additional notes ^
 | [[http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,799&Prod=S3BOARD|S3BOARD]] | PCIII | [[http://sourceforge.net/projects/xc3sprog/|xc3sprog]] | ''%%xc3sprog -d /dev/ppi0 -i BIT file.bit -i MCS file.mcs%%'' | Grzegorz Behrens | Removing 'Missing power' block is necessary from ioparallel.cpp | | [[http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,799&Prod=S3BOARD|S3BOARD]] | PCIII | [[http://sourceforge.net/projects/xc3sprog/|xc3sprog]] | ''%%xc3sprog -d /dev/ppi0 -i BIT file.bit -i MCS file.mcs%%'' | Grzegorz Behrens | Removing 'Missing power' block is necessary from ioparallel.cpp |
 +| S3ESK | XUSB_EMB | [[http://sourceforge.net/projects/xc3sprog/|xc3sprog]] | ''%%xc3sprog -c xpc <file.bit>%%'' | wkoszek@ | Some warnings appear while ''%%xc3sprog%%'' operation. Reported to the author. |
 +
 +===== Before publishing announcement =====
 +
 +  * bring fxload to mainstream development branch
 +    * prepare a port
 +    * check if ezload provides some more functionality for FX2
 +  * ''%%devd.conf%%'' rules for cables
 +  * mark "quick" steps with red background 
 +  * prepare command line options for ise
 +  * prepare tar.gzs for cross-checking
 +  * prepare scripts
 +  * prepare PROM programming example
  
 ==== Ideas ==== ==== Ideas ====
  
-* Explore possibilities of [[/CableServer|CableServer]]+* Explore possibilities of %%CableServer%%
  
 ---- ----
Line 282: Line 430:
 Script for Wiki link generation {{electronics/fpga/freebsd_xilinx/wiki_gen.sh?linkonly|wiki_gen.sh}} Script for Wiki link generation {{electronics/fpga/freebsd_xilinx/wiki_gen.sh?linkonly|wiki_gen.sh}}
 Script for thumbnail generation {{electronics/fpga/freebsd_xilinx/thumb_gen.sh?linkonly|thumb_gen.sh}} Script for thumbnail generation {{electronics/fpga/freebsd_xilinx/thumb_gen.sh?linkonly|thumb_gen.sh}}
 +
 +----
 +
 +{{tag>HowTo}}
  
  • electronics/fpga/freebsd_xilinx.1265413300.txt.gz
  • Last modified: 2010/02/05 23:41
  • by WojciechKoszek