Experiments with a Xilinx Spartan 3A FPGA

This is the project homepage for my experiments with a Xilinx Spartan 3A FPGA. The FPGA is bundled on an evaluation board (“Spartan 3A Evaluation Kit”) which used to be sold by Avnet.

Because I don’t get to spend time on this nearly as much as I’d like to, I often have to leave things untouched for months at a time. When I try to pick up where I left, I always have trouble remembering what I had done so far and how things work. I decided to put information about the various bits and pieces on here so I have somewhere to look it up.

Overview

The Avnet Eval Board I’m using features a Xilinx Spartan 3A (xc3s400a) FPGA with around 3,500 slices. Along with the FPGA, there is

  • a 128 MBits SPI flash,
  • 32 MBits of parallel NOR flash,
  • a bunch of general purpose I/O (GPIO) pins,
  • four buttons,
  • four LEDs.

The FPGA can be configured either through JTAG or from either the SPI or the parallel flash (selectable via a jumper).

I am using the board to learn about and gain experience with FPGA bevelopment. In particular, I want to make the FPGA flashes accessible from the outside world via I2C as well as LPC. Internally, I want to build a Wishbone infrastructure to connect the various logical blocks.

This is a long-term project made up of serveral somewhat independent sub-projects, some of which are complete while others haven’t even started, yet. The sub-projects that work are described and documented on the pages linked below:

  • gpio — A general purpose I/O pin driver (Wishbone Slave)
  • i2c_slave — An I2C slave that acts as a bridge to the Wishbone bus
  • spimaster — A simple and configurable SPI engine
  • wb_switch — The Wishbone interconnect logic

Hacking

To hack on the mentioned eval board, you need a set of tools. I generally use “Xilinx ISE WebPACK” software which is available free of charge from Xilinx. The Xilinx tools run equally well on both Windows and Linux.

For the Avnet board, you can use a programmer tool called “AvProg”. There’s a download link for the most recent version of the tool on the Avnet homepage, but unfortunately, I was unable to get the tool’s recent versions to work with my board. However, the version that came with the board basically worked.

The “avs3a” utility can be used to program the FPGA’s SPI configuration under Linux. I’ve got the impression that this tool is somewhat slower than the Windows equivalent.

When it comes to programming the FPGA, I found the Xilinx USB Programmer to be the better choice. For that to work properly on Linux, I found this site to contain highly useful information. The benefit of configuring the FPGA through JTAG via the Xilinx USB Programmer is speed: It’s a lot faster than writing the SPI configuration flash. The downside is that the FPGA will lose its configuration after it is reset.

Links