Around October 2021 I was searching Aliexpress and found a Chinese-made Virtex6 coprocessor board being sold by HPC FPGA Board Store. It cost around £70 at the time, and appeared to have some impressive features:
PROGRAM_B
switch)The design files (Mediafire link) include a pin map (in the form of an Excel spreadsheet) and some demo code, but no schematic diagram and very little English documentation.
A CH340 USB serial port is fitted above the SFPs, and connects to a standard mini USB connector.
There are three switches near the SFP connectors:
PROGRAM_B
– when pushed, forces the FPGA to reset and reprogram itself.PIN_A9
and PIN_A10
– pull the respective FPGA pins low when pushed.There are eight LEDs numbered D3 to D10. These are lit when the respective I/O pin (see spreadsheet) is pulled low.
A 78-pin (39 way, 2 row) 0.1in pin header carries 67 GPIOs. There is a mix of LVDS and LVTTL, as well as two LVDS GCLK (global clock) lanes.
The board is equipped with a PCI Express connector, which can operate in the x1, x4 or x8 speed modes.
Speed configuration is done via switch bank U8, near the PCIe connector:
Install ISE 14.7 System Edition, and use the licence included with the demo board design files. Without a licence, ISE will only allow the XC6VLX75 device to be selected.
The design files (RAR archive) include a number of test projects:
key_test
– push the buttons to toggle the LEDs.led_test
– walking LEDs testtwo_sfp_ibert_a_b
– test SFP ports A and B?two_sfp_ibert_c_d
– test SFP ports C and D?usb_ttl_com
– USB serial port testv6_pcie_gen1x8_riffa
– PCI Express device using the RIFFA framework.First take the orange tape off the PCIe DIP switch bank, and turn on the top three switches by moving them to the right. This enables PCI Express with a maximum lane width of x8.
If the FPGA is being loaded from a 'bit' file (not the SPI Flash), then the PC must be rebooted without powering off after the FPGA is loaded. This is because the PCI Express bus is only scanned on boot.
Under Linux, it is possible to check the card's link speed and PCIe lane width:
user@thinclient:~$ lspci ... 01:00.0 Memory controller: Xilinx Corporation Device 6018 ... user@thinclient:~$ cat /sys/bus/pci/devices/0000\:01\:00.0/current_link_speed 2.5 GT/s user@thinclient:~$ cat /sys/bus/pci/devices/0000\:01\:00.0/current_link_width 4
I'm testing on a HP t610 Plus thin client, which has a single PCIe x4 connector, hence the 4-lane limit. The speed of 2.5 GT/s indicates that PCI Express Gen-1 is in use.
The Linux driver in the original RIFFA repository doesn't build on later kernels, but an updated version is available. To test the card:
cd riffa/driver/linux && make && sudo make install
sudo modprobe riffa
– you can use dmesg
to see if the RIFFA driver was loaded.cd c_c++/linux/x64/sample_app && make
./testutil 0
displays the devices which RIFFA can detect../testutil 2 0 0 10000000
performs a speed test.It may be possible to rescan the PCIe bus and reset the card, provided the PCIe BAR configuration has not changed. This Stackoverflow thread presents some options, but I have not tried them.
The RIFFA documentation provides information on implementing a RIFFA channel interface to produce or consume data.
With RIFFA this would generally be done with the RIFFA libraries.
This Reddit FPGA subreddit post explains how to mmap
the PCI resource (/sys/devices/pci<partial_device_id>/<device_id>/resourceN
) and directly read and write registers.