Getting Started With FPGAs

I recently got my hands on an old Digilent Nexys 2 Spartan 3 FPGA development board.  These are fairly expensive even second hand, usually over 100 dollars, but can sometimes be had cheap on eBay.  Boards like this are often used by students, so once a class is over a bunch of them will be sold second hand.

Anyway, I haven’t got a terribly large amount done with the thing, but I wanted to post a few first impressions. By and large I’ve been a microcontroller guy for years now.  I wrote code for AVR before arduino was a thing.  I read the datasheets, I looked into the assembly for them.  Long before that I was a C, Java, and C++ programmer for Mac (OS 7 lol), Linux, and Windows. So I’m coming at it from the angle of someone who has done hardware, and software, but nothing in between.

The first noticeable thing about FPGAs is that the whole process is more poorly documented and difficult than something like AVR/Arduino.  Programming the boards is complicated.  Some development boards are programmed through a jtag interface, but many have an on board usb to jtag interface.  The gotcha here is that those aren’t standardized either.  You may end up having to buy a usb JTAG cable, you may need a custom cable to go from that to your board.  The digilent boards have onboard USB jtag programmers, but they require you to use digilent’s Adept2 software.  This is available for Linux and Windows, but the linux tools are commandline only, and it’s non obvious what the commands are once it’s installed.

Unlike software or microcontroller code, the tools for FPGA development are all proprietary.  Although some of them are “free” as in beer, you won’t find any popular open source synthesizers.  Xilinx offers ISE and Vivado for free as the Webpack edition with some limitations.

Again unlike a C/C++ compiler, FPGA code is very complicated to get to hardware.  It has to synthesize the logic, make a net list, place the devices, and route it through the mess of multiplexers that interconnect the logic devices of the FPGA.  Placement and routing amounts to a very large traveling salesman problem.  That means it is very computationally intensive to synthesize even simple vhdl or verilog programs.  It feels like writing software in the early 90s.

I use ubuntu at home so I’m going to post several howtos over the next few days, from installation of the tools to simple vhdl programs for synthesis and simulation.

Leave a Reply

Your email address will not be published. Required fields are marked *