My first FPGA development kit finally arrived this week, after some delays. The forums do show that there have been problems with distribution, but I can confirm that the miniSpartan6+ is still shipping as of September 2017.
Setting up the development environment
The following was set up on Ubuntu 16.04 LTS. It deviates somewhat from the Scarab Hardware walkthrough which appears to be obsolete in parts.
I just downloaded Xilinx ISE from their website, installed and launched it and followed through to get the licence.
It was a little bit annoying as it couldn’t activate it from inside the program, it rather saved an htm file which I then launched and was redirected through to the Xilinx website. After ticking a few boxes, I was emailed the .lic file.
This file is then loaded in through the next tab on the configuration manager.
USB Cable Driver
Installed the USB cable driver as directed by the Scarab walkthrough. The commands are copied verbatim below:
sudo apt-get install gitk git-gui libusb-dev build-essential libc6-dev-i386 fxload
sudo git clone git://git.zerfleddert.de/usb-driver
sudo ./setup_pcusb /opt/Xilinx/14.7/ISE_DS/ISE/
echo "PATH=\$PATH:/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/" >> ~/.bashrc
echo "export PATH" >> ~/.bashrc
Installing libFTDI for xc3sprog per the instructions on Scarab was an absolute nightmare. Instead of downloading source, changing directories, linking libraries, set up access permissions, and all that painful stuff, there was a much simpler answer:
svn co https://xc3sprog.svn.sourceforge.net/svnroot/xc3sprog/trunk xc3sprog sudo apt install libftdi* cd xc3sprog cmake . make sudo make install
Make sure to use sudo when using xc3sprog, otherwise it won’t find the device.
The first project is created with just the VHDL design code and the constraints file, for setting up pins to LEDs.
In Xilinx ISE the project is set up with the following steps:
- Select New Project from the File menu, and use the following parameters:
- Right click on “xc6slx25-3ftg256”, select New Source, and select and add a VHDL Module (this is the .vhd file)
- Right click on the newly made VHDL Module, select Add Source, and select Implementation Constraints File (this is the .ucf file)
Copy code into these files from a simple project which simply counts through LEDs 0 through 7 on the board. However, in the UCF file, change the following so that the counting occurs more slowly for easier observation:
NET "clk50" PERIOD = 20 ns | LOC = "K3"; # IO_L42P_GCLK25_TRDY2_M3UDM
NET "clk50" PERIOD = 100 ms | LOC = "K3"; # IO_L42P_GCLK25_TRDY2_M3UDM
Build this test code within Xilinx ISE.
Once the project is built, a file called led_Test.bit will be in the project directory. Plug in the miniSpartan6+ and download the file with:
sudo xc3sprog -c ftdi led_Test.bit
The 8 LEDs will now count from 0 to 255 and loop back to 0.