Progamming a CPLD (Xilinx XC9572XL) using Linux (Ubuntu 12.4 LTS) and the Bus Pirate

Today I would like to present a little tutorial how to program a CPLD (in this case a Xilinx XC9572XL) using Ubuntu 12.4 LTS (64 bit) and the Bus Pirate v3. All the information needed to achieve this is already out there, but not conveniently boiled down to a tutorial. At least I did not find one. So here we go:

The first thing you will need to program Xilinx CPLDs, is Xilinx’s ISE development environment. Fortunately there is a version for Linux, but unfortunately it took a few tricks to make it work on my system. I cannot guarantee that any of this will be necessary or even advisable for you since it might depend on your flavour of Linux and version of ISE, but it worked for me.

I already made my first mistake before installing anything. I downloaded the wrong development environment. So make sure to download the ISE Design Suite for Linux from xilinx.com (free registration required) and NOT the Vivado Design Suite. As far as I could see, the Vivado Design Suite does not support Xilinx’s small CPLDs.

At the time of this writing the newest version available is 14.5 and that’s what I will assume from now on.

The installation worked without any problems, but when it came to acquiring the free ISE Webpack license I ran into the next problem. When you select the Webpack licence the program is supposed to open your web browser and direct you to a site where you can acquire the license and have the license file sent to you via e-mail. This simply did not happen for me. Instead I got an error message about “libstdc++.so.6” in the ISE directoy. Apparently some libraries shipped with ISE are not compatible with the rest of my system, so I had to replace them with the system libraries.

So for 32 bit systems one has to:

sudo su
cd /opt/Xilinx/14.5/ISE_DS/ISE/lib/lin
mkdir orig && mv libstdc++* orig
cd /opt/Xilinx/14.5/ISE_DS/common/lib/lin/
mkdir orig && mv libstdc++* orig
exit

and on 64 bit systems:

sudo su
cd /opt/Xilinx/14.5/ISE_DS/ISE/lib/lin64
mkdir orig && mv libstdc++* orig
cd /opt/Xilinx/14.5/ISE_DS/common/lib/lin64/
mkdir orig && mv libstdc++* orig
exit

Now ISE will use the system libraries. If you don’t have the libstdc++ files on your system, you need to install “libstdc++6” using the package manager.

To start ISE you first have to set a few environment variables. Fortunately there are scripts for that.

On 32 bit systems:

. /opt/Xilinx/14.5/ISE_DS/settings32.sh
ise

and on 64 bit systems:

. /opt/Xilinx/14.5/ISE_DS/settings64.sh
ise

will do the trick.

At this point ISE worked, but it did not save any preferences. This was just a matter of access rights. To make everything work smoothly you have to change the owner and group of ~/.Xilinx, ~/.config/Xilinx and all sub directories and files from root to your user name.

Now that the development environment is set up, we will create a small example project which we will use to test if everything works as intended.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: