Vous êtes sur la page 1sur 10


Project logs Spartan-6 FPGA Hello World Hackaday.io


Spartan-6 FPGA
Hello World
Project logs
My first FPGA project using
Technolomaniac's board
created by Mike Szczys 08/30/2014 at 15:16 4

Back to project details



Really Xilinx? Really?

08/30/2014 at 15:18 0 comments

This board has a Xilinx Spartan-6 on it. So in essence, when

you buy a board you have already purchased the hardware
from Xilinx. So it's nice to see they have a free IDE called
But when you go to download it you get the shakedown about
non-export and what your corporate address and application
are. These are mandatory fields you must fill in before
download the software. I haven't done a thing with the
hardware yet and I already have a sour taste in my mouth.

IMPORTANT: Don't Install

Vivado as Spartan-6 is not



Project logs Spartan-6 FPGA Hello World Hackaday.io

Wow, Xilinx needs to work on presenting better information on
their webpage. Below I documented how to install Vivado...
their current generation software suite for their FPGAs.
Guess what? Vivado doesn't support Spartan-6. It only
supports 7 Series, Zynq-7000, and UltraScale parts. For
Spartan-6 you need to useEnd-of-Life Xilinx ISE Design Suite.
I'm currently having fun watching the 6.8 GB install "Full
Installer for Linux" creep along. Sheesh!
Getting the Vivado installer running on Ubuntu
Installer crashes on Ubuntu.This thread yields the following
commands which are a workaround.
chmod +x
n --target Xilinx_Install_temp<br>
cd Xilinx_Install_temp
Now edit the xsetup file and replace "#!/bin/sh" with
sudo ./xsetup
Now the GUI setup window will launch. I didn't run as sudo the
first time and a couple of screens in the GUI complains about
write permisisons for /opt/Xilinx.

9.18 GB




Project logs Spartan-6 FPGA Hello World Hackaday.io

Check that download size and disk space. I'm trying to blink
and LED and I've got a 1.89 GB download standing in my way?
Maybe this is commonplace for the FPGA crowd, but I'm a fan
of programming for embedded using a text editor and
makefile (okay, I do use Eclipse more regularly these days but
you know what I'm talking about).
As I said above, this does me no good because I have a
Spartan-6 I'm trying to work with. I'll post another log on how
to install ISE Design Suite.

Install Xilinx ISE Design Suite

09/01/2014 at 16:22 0 comments

Xilinx offers software for Windows or Linux. I'm a Linux-only

person so I went that route. Here's how I set up the ISE Design
Suite under Linux Mint 17:

Download the installer

I downloaded the "ISE Design Suite" "Full Installer for Linux"
from the middle of this



Project logs Spartan-6 FPGA Hello World Hackaday.io

The package is about 6.8 GB so download ahead of time.

Unpack and Install

1) untar the install package to a large partition
2) edited the "xsetup" file so that it reads "#!/bin/bash" at the
top of the file
3) run "sudo ./xsetup" and the GUI installer will run
4) I chose not to install to the /opt directory. <strikethrough>If
you want it installed there you either need to run the installer
as sudo or create the Xilinx directory and set permissions to
allow your user account to write to it.</strikethrough> You
need to run the installer as sudo or it will bomb out at the end
of the process.
5) The installer will take a very long time to complete. In my
case it was about 75 minutes.

Realy Xilinx, Really? (Part 2)

I went through the entire installation process (75 minutes) and
at the end was greeted with a pop-up that said "driver
installation failed because you don't have root priviledges". No
problem, I'll just install the cable drivers as sudo and fix it!
Nope, when I went to do that it told me that the Xilinx directory
already existed and I would need to choose a different
location. Really Xilinx? Doesn't it seem like you should perform
the root privilege test at the beginning of the process instead
of bombing out at the end?

Launching ISE Design Suite




Project logs Spartan-6 FPGA Hello World Hackaday.io

09/01/2014 at 16:47 0 comments

After going through the ISE Design Suite installation process

I'm left with no apparent way to launch the software. I found
this thread to help a
1) Navigate to the Xilinx ISE install directory
2) Run the setup file "./settings64.sh" (you may need to chmod
+x that file first)
3) Run ./ISE in the ISE_DS/bin/lin64 directory

Fighting with Xilinx

When the ISE Suite launches I get this lovely warning:

Guess what? When you click okay it doesn't launch the

configuration manager like it says it's going to.
4) Add the "Xilinx/14.7/ISE_DS/common/bin/lin64/" directoryto
your paththen run ./ise again. This time dismissing the error
window will launch the license manager.
5) Generate a free ISE WebPACK license by going
6) Download the license that Xilinx emailed to you into your



Project logs Spartan-6 FPGA Hello World Hackaday.io

~/.Xilinx/. directory
7) On the Xilinx License Configuration Manager hit the refresh
button at the bottom. This should give you a few green boxes
in the Version Limit column. Now hit close
Now when you launch ISE there should be no license error.

Installing Xilinx Platform Cable USB

Drivers for Linux
09/01/2014 at 20:57 0 comments

Hey, more Linux fun to get Xilinx drivers working on a "nonsupported" platform (Ubuntu).
Trying to run the cable driver install script bombs out. Finding
my way to a workaround for this really really really sucked. I
think i have at least 2 hours into this. Finally found this page...
follow it religiously:

iMPACT cable lock error

09/01/2014 at 21:38 0 comments

I was able to poll the FPGA using the Platfrom Cable USB but
then all of the sudden I wasn't. I would get the error telling me
that the cable was being used by another application. This
bug report shows how to clear a bad cable
impact -batch



Project logs Spartan-6 FPGA Hello World Hackaday.io

Successful Hello World!

09/01/2014 at 21:48 0 comments

I can now program FPGA!! Well, I can copy someone else's

example code and get it to work on my device. Check out this
excellent video which shows how to write VHDL to make an
LED blink:

VHDL with Xilinx - LED Blink Tutorial

When following that tutorial you simply need to select the

correct hardware:




Project logs Spartan-6 FPGA Hello World Hackaday.io

For the pinout you need to look at the FPGA Development

Board PDF schematics found here:
The pinouts are shown on page 6:

I know from other parts of that document that the crystal

oscillator is connected to the FPGA_CLK signal and the LED
I'm targeting is connected to IO12. These correspond to P56
and P134 which are used in the pins file.
Here is the code that allowed me to get an LED blinking. Note
that this is designed for a 50MHz oscillator but this board
actually has a 20MHz oscillator. For this example I don't care
about the timing error.
library IEEE;




Project logs Spartan-6 FPGA Hello World Hackaday.io

entity LED_Blink is
port (
CLK_50MHz: in std_logic;
LED: out std_logic
end LED_Blink;

architecture Behavioral of LED_Blink is

signal Counter:
std_logic_vector(24 downto 0);
signal CLK_1Hz: std_logic;

Prescaler: process(CLK_50MHz)
if rising_edge(CLK_50MHz)
if Counter <
"1011111010111100001000000" then
Counter <=
Counter + 1;
CLK_1Hz <=
not CLK_1Hz;
Counter <=
(others => '0');
end if;
end if;
end process Prescaler;
LED <= CLK_1Hz;

end Behavioral;
NET "CLK_50MHz" LOC = "P56";
NET "LED" LOC = "P134";



Project logs Spartan-6 FPGA Hello World Hackaday.io

That's it! Hello Word!

Going up?
About Us

Contact Hackaday.io

Give Feedback

Terms of Use

Privacy Policy

2015 Hackaday