Xilinx on Linux HOWTO


by B. Joshua Rosen, bjrosen@polybus.com,

Polybus Systems Corp

Westford, MA

(978)828-0944



Polybus is now offering in system FPGA test patterns for all Xilinx FPGA families. For more information please see

http://www.polybus.com/xilinx_test_patterns/


What's New:

04/25/2003: Xilinx officially began supporting Xilinx tools under Wine as of the 4.1 release, native Linux support is promised for the fall of 2003 (the 6.1 release). As of version 5.1 Xilinx dropped support for Win98, the implication for Linux users is that it became necessary to specify the windows version in the .wine/config file in order to run the GUI applications like fpga_editor. If you already have a .wine/config file you will need to add the following section,

[version]
"windows" = "win2k"

In other news Mentor has released a new synthesis tool called Precision which is available for Linux.

05/30/2001: Synplicity has announced that their entire tool suite is now available on Linux, they now join Cadence and Synopsys who have already ported their products to Linux.

I've been heavily using Cadence's NC-Verilog and Signalscan on a Redhat 6.2 system for the last 5 months and I can report that both tools have been very solid. I've also used Synopsys's VCS, Virsim and Design Compiler on Linux and they have also been reliable.

01/20/2001 There is a bug in the NT version of map in the 3.3i SP6 release of the Xilinx tools, this is a problem with map not with Linux or WINE. The bug causes map to seg fault. Xilinx has a patch available that fixes the bug. The patched version of map works fine.

I've just installed the Linux version of NC-SIM on my laptop. It's very fast and works without a hitch. The Linux version of Signalscan also works very nicely. Also I've placed a new version of HDLmaker on the web along with a new users guide. HDLmaker is an open source hierarchical Verilog/VHDL generator that simplifies the development of complex FPGAs and ASICs.

01/05/2001 Win4Lin 2.0 has been released. The 2.0 version of Win4Lin handles flexlm so it's now possible to use it with licensed tools such as Synplify. I've run Synplify under Win4Lin and the only problem is caused by Win4Lin's 64M memory limit. 64M of RAM is adequate for many XCV300 designs but is not sufficient for large FPGA designs.

The 3.2i release of of the Xilinx tools revealed a heap handling bug with Wine release 20001002 and earlier. The heap problem has been fixed in later releases. I recommend using release 20001202 or 20001222 of Wine.

Wine releases after 20001002 require that a new switch be added to the [wine] section of the .winerc file in order to handle symbolic links. The symbolic link directive is:

ShowDirSymlinks=1

Wine release 20001222 replaces the .winerc file with .wine/config which has a slightly different format. The conversion between .winerc and .wine/config is automatic. An example of the new .wine/config file format is show below.

8/10/2000 The problems with Wine version's after 20000526 have been resolved. A major change was introduced in version 20000614 which required changes to the scripts, which are provided on this page. Also I'm now recommending that Wine be installed in it's own directory rather than in the default directories to reduce the possibility of library conflicts between different revisions of Wine.

Win4Lin still can't handle FlexLm so there still is no solution for running a floating license version of Synplify on Linux. I suspect that the single machine licensed version should work but I haven't tried it.

6/27/2000 There seems to be a bug in Wine version 20000614 which prevents the scripts provided here from working. Although though there is a work around, I recommend using Wine version 20000526 instead.

6/18/2000 The big news is that Cadence is now offering their full set of logic tools on Linux. With the addition of Cadence all of the major simulators are now available on Linux, Synopsys VCS, Cadance NC Sim, Modeltech ModelSim and Avant! Polaris. The weak area is now synthesis, as of now there are still no native synthesis tools on the Linux platform. For the near term the best hope is running synthesis tools under an emulation environment, either Wine or Win4Lin, I've not had much luck getting Synplify to run under Wine but Win4Lin should be able to handle it once they fix a problem with their WinSock driver that is preventing FlexLm from working.

As mentioned above there is is now another alternative for running Windows Apps under Linux, Win4Lin from Netraverse.Win4Lin differs from Wine in that it is not an emulator but a virtual machine that sits between Windows 98 and Linux. Win4Lin is not free, but it's cheap ($49) .

In other news Wine release 20000614 is even better. I've been using FPGA_EDITOR under wine without any problems. Script driven place and route also works without a hitch. The new Xilinx 3.1i tools have not introduced any new problems and continue to work under Wine.


1/31/2000    Wine release 20000130 is a step forward.  FPGA_EDITOR almost works, I was able to open a routed XCV300 and examine it without crashing. There are font problems so it's hard to read the text inside of macro block. And I wasn't able to edit a macro. Also dsgnmgr can now create a project without crashing, but it can't implement it.




Introduction:
Running Xilinx place and route tools on Linux is a snap for any one who's normal environment is UNIX, most shell scripts will run with little or no modification. This HOWTO provides a step by step procedure for setting up a Linux system to run Xilinx Tools. Any comments, corrections or additional information should be sent to bjrosen@polybus.com.

What Hardware is Required:
The most important thing is memory, Xilinx tools are memory hogs, the larger the FPGA the larger the memory requirements.  The requirements for Linux are pretty much the same as for Windows, so check with Xilinx about their requirements for any particular FPGA. For medium sized FPGAs (XCV300), 512M is sufficient. For large Virtex2 designs I'm using 2G but 1G is probably adequate.

What Software is Required:
Besides Linux and the Xilinx software you will need WINE (the windows emulator software for Linux). I also recommend Win4Lin from Netraverse which is a virtual machine that allows you to run Windows 98 on top of Linux, Win4Lin requires that you have a Windows 98 License.

What Linux System to Use:
I'm currently running the Xilinx tools under Redhat 7.3. In the past I've run them on Redhat 6.2, 7.0, 7.1 and 7.2. Any current Linux distribution should work, however I recommend that you don't use the Wine RPMs that come with the distribution which tend to be stale, but instead install the latest version of Wine off of the Wine website (see the next section).

There aren't any hardware requirements except for having sufficient memory. I'm running the tools on a a range of systems including a 500Mhz/512Mb PIII Dell Laptop, a 500 Mhz/512Mb PIII desktop, a dual 1GHz/1Gb PIII server and a dual 2.66GHz/2Gb P4 Xeon server. I've never encountered a problem with any system.

Which version of WINE to use:
The Xilinx place and route tools version 5.2 should be run on a recent version of Wine, I'm using version 20030403 which is the April 2003 release.

Where to get WINE: http://www.winehq.com

Win4Lin: http://www.netraverse.com

Win4Lin is a virtual machine that allows you to run Windows 98 on top of Linux. In my opinion it's complementary to Wine and not a replacement for it. It was possible to use Win4Lin to install and run the Xilinx tools up to version 4.2. As of version 5.1 Xilinx stopped supporting Win98 so it's no longer possible to use Win4Lin to install or run any of the current Xilinx tools. Win4Lin is still the best way to run applications like Framemaker and Word.

What works, what doesn't:
Fortunately the Xilinx place and route tools are really UNIX programs that have been ported to Windows, so the command line interfaces are identical to the UNIX versions. In general the rule is, if you can run it from a command line it works, if it requires a GUI it may or may not. Most of the graphical tools, such as fpga_editor and floor_planner work fine. I haven't been able to make the project navigator work but frankly I haven't tried very hard because it's not something I ever use.

Installing the Xilinx Tools:

Starting with version 4.1 Xilinx officially supports their tools running under Wine on Linux. It's possible to directly install the tools from the Xilnx CD-ROMs, however I find that it's easier to install the tools on a Win2K machine and then copy the Xilinx directory to my Linux systems using SAMBA.

Setting up WINE:

I recommend that each release of Wine be installed in it's own directory rather than in the default directories (/usr/local/lib, /usr/local/bin). A new version of Wine is released every few weeks, and occasionally certain library conflicts arise between and older version and a newer version. To reduce the probability of problems use the --prefix switch to the install script to specify a unique directory for that version of wine. Also it's a good idea to clean out your .wine directory when ever you switch versions of Wine.

setenv WINE /usr/local/wine_version#

setenv LD_LIBRARY_PATH ${WINE}/lib:${LD_LIBRARY_PATH}

set path=($WINE/bin ${path})

In your .wine/config file there are a several things that you must set in order for the Xilinx tools to run. These are

; Allow the window manager to manage created windows
"Managed" = "Y"
 
"msvcrt" = "native, builtin"
 
[Drive F]
"Path" = "${XILINX}"
"Type" = "hd"
"Label" = "Home"
"Filesystem" = "win95"
 
[wine]
"Windows" = "c:\\windows"
"System" = "c:\\windows\\system"
"Temp" = "e:\\"
"Path" = "c:\\windows;c:\\windows\\system;e:\\;e:\\test;f:\\"

Required Environment Variables:
Set the XILINX env variable to the Xilinx directory, in the example below the Xilinx directory is in /usr/local/tools/Xilinx:

setenv XILINX          /usr/local/tools/Xilinx

Required Scripts:
To run the Xilinx programs under wine you will need a set of scripts which invoke the programs. As an example the script par, which executes par.exe, is shown below:

Wine Versions 20000614 and later, note that the last switch to wine is followed with a --:

#!/bin/csh -f

exec wine --debugmsg fixme-all -- "$XILINX/bin/nt/par.exe" $*

A complete set of scripts is provided here in a directory called xwine. To install the scripts just gunzip and untar them and add the path to your .cshrc. As an example on my system I have the xwine directory located in /home/usr/tools:

setenv XWINE /home/usr/tools/xwine
set path = (${XWINE} $path )

 

Download Scripts:

The xwine scripts are also included in the HDLmaker package available from

http://www.polybus.com/hdlmaker/users_guide/

Sample shell scripts:

runvirtex:

#!/bin/csh -f
/bin/uname -a
date
echo edif2ngd $1.edf
edif2ngd $1.edf
echo ngdbuild $1.ngo -uc $1.ucf -p $2-$3-$4
ngdbuild $1.ngo -uc $1.ucf -p $2-$3-$4
echo map  -pr b -p $2-$3-$4 $1
map  -pr b -p $2-$3-$4 $1

echo par -l $5 -w $1 $1_r.ncd
par -l $5 -w $1 $1_r.ncd
date
echo trce -v 25 $1_r.ncd $1.pcf
trce -v 25 $1_r.ncd $1.pcf
make_bit_virtex $1
echo promgen -p exo -s 4096 -u 0 $1_r
promgen -p exo -s 4096 -u 0 $1_r
 

rm *.ngm
rm *.ngo
rm *.ngd
rm *.ncf

Sample .wine/config

WINE REGISTRY Version 2
;; All keys relative to \\Machine\\Software\\Wine\\Wine\\Config

;;
;; MS-DOS drives configuration
;;
;; Each section has the following format:
;; [Drive X]
;; "Path"="xxx" (Unix path for drive root)
;; "Type"="xxx" (supported types are 'floppy', 'hd', 'cdrom' and 'network')
;; "Label"="xxx" (drive label, at most 11 characters)
;; "Serial"="xxx" (serial number, 8 characters hexadecimal number)
;; "Filesystem"="xxx" (supported types are 'msdos'/'dos'/'fat', 'win95'/'vfat', 'unix')
;; This is the FS Wine is supposed to emulate on a certain
;; directory structure.
;; Recommended:
;; - "win95" for ext2fs, VFAT and FAT32
;; - "msdos" for FAT16 (ugly, upgrading to VFAT driver strongly recommended)
;; DON'T use "unix" unless you intend to port programs using Winelib !
;; "Device"="/dev/xx" (only if you want to allow raw device access)
;;
[Drive A]
"Path" = "/mnt/floppy"
"Type" = "floppy"
"Label" = "Floppy"
"Serial" = "87654321"
"Device" = "/dev/fd0"

[Drive C]
"Path" = "/home/bjrosen/win"
"Type" = "hd"
"Label" = "MS-DOS"
"Filesystem" = "win95"

[Drive D]
"Path" = "/mnt/cdrom"
"Type" = "cdrom"
"Label" = "CD-Rom"
"Filesystem" = "win95"
; make sure that device is correct and has proper permissions !
"Device" = "/dev/cdrom"

[Drive E]
"Path" = "/tmp"
"Type" = "hd"
"Label" = "Tmp Drive"
"Filesystem" = "win95"

[Drive F]
"Path" = "${XILINX}"
"Type" = "hd"
"Label" = "Home"
"Filesystem" = "win95"

[Drive Z]
"Path" = "/"
"Type" = "network"
"Label" = "Root"
"Filesystem" = "win95"

[wine]
"Windows" = "c:\\windows"
"System" = "c:\\windows\\system"
"Temp" = "e:\\"
"Path" = "c:\\windows;c:\\windows\\system;e:\\;e:\\test;f:\\"
"Profile" = "c:\\windows\\Profiles\\Administrator"
"GraphicsDriver" = "x11drv"
; Wine doesn't pass directory symlinks to Windows programs by default.
; Enabling this may crash some programs that do recursive lookups of a whole
; subdir tree in case of a symlink pointing back to itself.
;"ShowDirSymlinks" = "1"
"ShellLinker" = "wineshelllink"

# <wineconf>

[DllDefaults]
; "EXTRA_LD_LIBRARY_PATH" = "${HOME}/wine/cvs/lib"
"DefaultLoadOrder" = "native, builtin, so"

[DllOverrides]
"commdlg" = "builtin, native"
"comdlg32" = "builtin, native"
"ver" = "builtin, native"
"version" = "builtin, native"
"shell" = "builtin, native"
"shell32" = "builtin, native"
"lzexpand" = "builtin, native"
"lz32" = "builtin, native"
"comctl32" = "builtin, native"
"commctrl" = "builtin, native"
"wsock32" = "builtin"
"winsock" = "builtin"
"advapi32" = "builtin, native"
"crtdll" = "builtin, native"
"mpr" = "builtin, native"
"winspool.drv" = "builtin, native"
"ddraw" = "builtin, native"
"dinput" = "builtin, native"
"dsound" = "builtin, native"
"mmsystem" = "builtin"
"winmm" = "builtin"
"msvcrt" = "native, builtin"
"msvideo" = "builtin, native"
"msvfw32" = "builtin, native"
"mcicda.drv" = "builtin, native"
"mciseq.drv" = "builtin, native"
"mciwave.drv" = "builtin, native"
"mciavi.drv" = "native, builtin"
"mcianim.drv" = "native, builtin"
"msacm.drv" = "builtin, native"
"msacm" = "builtin, native"
"msacm32" = "builtin, native"
"midimap.drv" = "builtin, native"
"wnaspi32" = "builtin"
"icmp" = "builtin"

[x11drv]
; Number of colors to allocate from the system palette
"AllocSystemColors" = "100"
; Use a private color map
"PrivateColorMap" = "N"
; Favor correctness over speed in some graphics operations
"PerfectGraphics" = "N"
; Color depth to use on multi-depth screens
;;"ScreenDepth" = "16"
; Name of X11 display to use
;;"Display" = ":0.0"
; Allow the window manager to manage created windows
"Managed" = "Y"
; Use a desktop window of 640x480 for Wine
;"Desktop" = "640x480"
; Use XFree86 DGA extension if present
"UseDGA" = "Y"
; Use XShm extension if present
"UseXShm" = "Y"
; Enable DirectX mouse grab
"DXGrab" = "N"
; Create the desktop window with a double-buffered visual
; (useful to play OpenGL games)
"DesktopDoubleBuffered" = "N"
; Code page used for captions in managed mode
; 0 means default ANSI code page (CP_ACP == 0)
"TextCP" = "0"
; Use this if you have more than one port for video on your setup
; (Wine uses for now the first 'input image' it finds).
;; "XVideoPort" = "43"

[fonts]
;Read documentation/fonts before adding aliases
"Resolution" = "96"
"Default" = "-adobe-times-"

[serialports]
"Com1" = "/dev/ttyS0"
"Com2" = "/dev/ttyS1"
"Com3" = "/dev/ttyS2"
"Com4" = "/dev/modem"

[parallelports]
"Lpt1" = "/dev/lp0"

[spooler]
"LPT1:" = "|lpr"
;"LPT2:" = "|gs -sDEVICE=bj200 -sOutputFile=/tmp/fred -q -"
;"LPT3:" = "/dev/lp3"

[ports]
;"read" = "0x779,0x379,0x280-0x2a0"
; "write" = "0x779,0x379,0x280-0x2a0"

[spy]
"Exclude" = "WM_SIZE;WM_TIMER;"

[registry]
;These are all booleans. Y/y/T/t/1 are true, N/n/F/f/0 are false.
;Defaults are read all, write to Home
; Global registries (stored in /etc)
"LoadGlobalRegistryFiles" = "Y"
; Home registries (stored in ~user/.wine/)
"LoadHomeRegistryFiles" = "Y"
; Load Windows registries from the Windows directory
"LoadWindowsRegistryFiles" = "Y"
; TRY to write all changes to home registries
"WritetoHomeRegistryFiles" = "Y"
; Registry periodic save timeout in seconds
; "PeriodicSave" = "600"
; Save only modified keys
"SaveOnlyUpdatedKeys" = "Y"

[Tweak.Layout]
;; supported styles are 'Win31'(default), 'Win95', 'Win98'
"WineLook" = "Win98"

[Console]
;"Drivers" = "tty"
;"XtermProg" = "nxterm"
;"InitialRows" = "25"
;"InitialColumns" = "80"
;"TerminalType" = "nxterm"

[Clipboard]
"ClearAllSelections" = "0"
"PersistentSelection" = "1"

[version]
"windows" = "win2k"

# </wineconf>

Download .wine/config file

config.tar.gz
 
 
Linux CAE Tools
 Name  Type  Status  Support
 Precision Commercial Synthesis Precision is Mentor's latest synthesis tool, replacing Leonardo. The Linux version of Precision is stable.
 Finsim Commercial Verilog Simulator Finsim is the original Linux Verilog simulator. It's performance is very good and it's stable. Excellent, Fintronics is a small company so they can respond very quickly to problems. 
 Finfarm Simulation Management tool for handling large numbers of simulations Works in conjuction with Finsim  
 ModelSim Commercial Verilog & VHDL Simulator ModelSim is a well established Windows mixed Verilog and VHDL simulator that is now in available on Linux.  
 VBS Free Verilog Simulator  In development  
Icarus Verilog Free Verilog Simulator/Synthesis Icarus is the leading free verilog simulator. I haven't tried it recently but judging from newgroup traffic it seems to have become fairly popular.  
V2000 Project Free Verilog/VHDL  In development  
 GTKWave Free Wave Viewer Works pretty well, although it's definitely beta software. I've found it quite useful in its current state. Excellent, turnaround time for bug fixes, most are fixed in a few hours.
 Signalscan Commerical Wave Viewer Signalscan is probably the most popular wave viewer. The Linux version works identically to the other Unix versions. I've haven't encountered any major glitches in it.  
Undertow VIII Commercial Wave Viewer Undertow VIII is a multi platform wave viewer. It works well and it's stable, but it has as a few annoying GUI bugs. Getting better. Linux has always been last on their support list, but I'm getting the impression that it's staring to get more attention.
VCS Commercial Verilog Simulator VCS, from Synopsys,  is the dominant verilog simulator in the ASIC world. It's been available on Linux since the middle of 1999. I've never had a problem with VCS (I've only used it on Solaris, not Linux) so I've never had to use their support. If someone would like to report their experiences to me I'll add them to this page.
 NC Sim Commericial Verilog and VHDL NC Sim, from Cadence is another leading Verilog/VHDL simulator that is well established in the ASIC world.  
 BlueHDL  Commericial VHDL BlueHDL is a low cost VHDL simulator ($1495).  
 Savant  Free VHDL Savant is a GPLed VHDL project at the University of Cincinatti  
 HDLmaker  Free Verilog/VHDL hierarchy generator HDLmaker generates Verilog/VHDL hierachical code. In addition it creates all of the scripts, project, and constraint files for most of the common tools, including Finsim,VCS, Synopsys, NCverilog, Synplify, and of course Xilinx. HDLmaker is licensed under the terms of the BSD license. I wrote and maintain HDLmaker. I've been using it continously since 1994 so it's fairly robust at this point. If you ask me nicely I'll fix any bugs that you report and maybe even add a simple enhancement.

Other Links:

http://www.geda.seul.org

http://www.verilog.net

http://www.opencores.org

Installing Mentor Tools Under Linux

home