banner

Programming the FPGA-384 board using a Raspberry Pi.

In order to program the the FPGA-384 board you to have some additional software installed. The additional software is known as a tool chain.

Until recently, programming an FPGA required an expensive FPGA vendor supplied tool chain. Then, the ability to program Lattice iCE FPGA's was developed using some open source tools called Project IceStorm from Clifford Wolf and Mathias Lasser.

The IceStorm programming sequence consists of writing a Verilog text file, compiling it using Yosys, running a place and route tool called Arachne-pnr, packing the resulting file to an iCE binary format using Icepack and then programming the bin file to the FPGA-384 board using the programmer from this site.

The IceStorm tool chain is Linux only so it will be assumed here that you will use a Raspberry Pi to run the tool chain, although any linux distro can be used.

Additionally there are some other tools to load the tool chain generated files onto the board. These are specific to the Raspberry Pi or an Arduino and each have their own instructions.

The following instructions for installing the IceStorm tool chain assume that you have installed a fresh copy of the Raspbian Lite OS, have the Raspberry Pi connected to the internet and have logged into the shell. Where it asks for permission to install items then allow it.

sudo apt-get update sudo apt-get upgrade sudo apt-get install build-essential clang bison flex libreadline-dev \ gawk tcl-dev libffi-dev git mercurial graphviz \ xdot pkg-config python python3 libftdi-dev git clone https://github.com/cliffordwolf/icestorm.git icestorm cd icestorm make sudo make install git clone https://github.com/cseed/arachne-pnr.git arachne-pnr cd arachne-pnr make sudo make install git clone https://github.com/cliffordwolf/yosys.git yosys cd yosys make sudo make install

Now you must obtain the example files and this boards tools which enable you to load those examples to the board.

git clone https://github.com/siliconfrog/fpga-384.git fpga-384 cd fpga-384

If you list the directory contents then you should see a lot of directories for the examples such as Blink. The directory fpga-384 is the utility to program the board FPGA and its Flash chip. It is useful to build this utility. The examples will also build it as part of their Makefile.

cd fpga-384/pi make

And then you can run it.

./fpga-384

Where upon it will show the utility useage and help.

Usage: fpga-384-control [] Options: [-h|--help] Show this help [-p|--program] Program the FPGA. Requires [-r|--read] Show the flash contents [-w|--write] Write the data to the flash. Requires [-e|--erase] Erase the flash [-d|--id] Get the flash ID [-i|--interactive] Interactive mode Program to FPGA

You can use this utility to erase and program the Flash memory as detailed here, or use it to program the FPGA with a bin file. The examples build a test harness to clock data into the FPGA as well and the test harness builds the programming functionality into these test harnesses for your convenience.