RIFFA‎ > ‎


RIFFA 2.0 is a rewrite of the RIFFA 1.0 Reusable Integration Framework for FPGA Accelerators. It does not rely on a PCIe Bridge and therefore is not subject to the limitations of a Bridge implementation. RIFFA 2.0 works directly with the PCIe Endpoint and can run fast enough to saturate the PCIe link. As before, the framework requires a PCIe enabled workstation and a FPGA on a board with a PCIe connector. Both the software and hardware interfaces have been greatly simplified. No more bus addressing knowledge is required. Additional improvements include support for Linux and Windows, software bindings for C/C++, Python, and Java. RIFFA 2.0 also supports multiple installed FPGAs. The new version is still open source and can be downloaded here.

On the software side, users can communicate with FPGA IP cores by writing only a few lines of code, as in the example C code below. Further details can be found on the language specific software interface pages (C/C++, Java, Python).

Application Example

#include <stdio.h>
#include <stdlib.h>
#include <riffa.h>

#define BUF_SIZE (1*1024*1024)
unsigned int buf[BUF_SIZE];

int main(int argc, char* argv[]) {
  fpga_t * fpga;
  int fid = 0; // FPGA id
  int channel = 0; // FPGA channel

  fpga = fpga_open(fid);
  fpga_send(fpga, channel, (void *)buf, BUF_SIZE, 0, 1, 0);
  fpga_recv(fpga, channel, (void *)buf, BUF_SIZE, 0);
  return 0;

On the hardware side, users access an interface with independent transmit and receive signals. The signals provide transaction handshaking and a first word fall through FIFO interface for reading/writing data. No knowledge of bus addresses, buffer sizes, or PCIe packet formats is required. Simply send data on a FIFO interface and receive data on a FIFO interface. Details can be found on the hardware interface page.

As with RIFFA 1.0, the communications model is based on direct memory access (DMA) transfers and interrupt/doorbell signaling. This achieves high bandwidth over the PCIe link. In our tests we are able to saturate (or near saturate) the link in all our tests. We have tested RIFFA on Xilinx FPGA development boards: ML605 and VC707, as well as the AVNet Spartan 6 LX150T. We have tested configurations with PCIe Gen1 x1, x8 and PCIe Gen2 x8. We have used Xilinx ISE 14.2 and Vivado 2013.2. RIFFA has be tested on Fedora 13 & 17 (32/64 bit vers.) and Ubuntu Desktop 10.04 LTS & 12.04 LTS (32/64 bit vers.). RIFFA relies on a custom Linux kernel driver which is supported on Linux kernels 2.6.27+ (tested on versions between 2.6.32 - 3.3.0). The Windows driver is supported on: Windows 7 in both 32 bit and 64 bit variants.