FPGAprog

This is an unofficial port of the fpgaprog utility that works on OSX. It can be used to flash or load bit-files to the Pipistrello board from Saanlima.

Installation

You need to install both libftdi and libusb-1.x. If you are using HomeBrew, you can install them by:

$ brew install libftdi libusb

Once installed, you can compile the sources by issuing make:

$ make
...
$ ls fpgaprog
fpgaprog

Copy the resulting fpgaprog binary to some place safe, and if you want to flash bit-files to the flash memory of your FPGA-board, you also need to copy the correct bscan_spi bit-file. For the Pipistrello, this bit-file is named bscan_spi_lx45_csg324.bit.

By default, OSX ships and loads its own (serial) driver for FTDI devices. This driver does not work well with libftdi, so before you can use this utility you need to unload that module:

$ sudo kextunload -b com.FTDI.driver.FTDIUSBSerialDriver

Usage

The fpgaprog program takes the following options:

-v                   enable verbose output;
-j                   detect JTAG chain, nothing else;
-d                   FTDI device name;
-f <bitfile>         main bit file to load/flash;
-b <bitfile>         bscan_spi bit file (enables SPI access via JTAG);
-s [e|v|p|a]         SPI Flash options:
                       e = erase only,
                       v = verify only,
                       p = program only or
                       a = all (default);
-c                   display current status of FPGA;
-C                   display STAT Register of FPGA;
-r                   trigger a reconfiguration of FPGA;
-a <addr>:<binfile>  append binary file at addr (in hex);
-A <addr>:<binfile>  append binary file at addr, bit reversed.

To load (not flash) a bit file:

$ fpgaprog -v -f <bit_file>

To flash a bit file, you need to enable the SPI port to the flash chip through the JTAG port:

$ fpgaprog -v -f <bit_file> -b path/to/bscan_spi_lx45_csg324.bit -sa -r

Download

I’ve not made any binary releases, but you can find the sources on my GitHub repository.

License

The code is licensed under GPLv2. All modifications made by me (JaWi) are licensed under GPLv2 as well.

About

This code is based on the source code provided by Magnus Karlsson from Saanlima and can be found here.