Programming the FPGA

Programming the FPGA via JTAG

If your FPGA is not already programmed with the Vollo accelerator then please follow these instructions to load the bitstream into the accelerator card's flash memory.

This requires a USB cable to be connected to the accelerator card and Quartus programmer to be installed on the system so that the device can be programmed over JTAG.

If the FPGA card already has a Vollo Accelerator Bitstream, it can be updated over PCIe by following the steps in the section Program the FPGA via PCIe below. Note that you only need to update the bitstream if updating to an incompatible version of the Vollo SDK. Programming over PCIe is faster than programming over JTAG, and does not require a USB programming cable or for Quartus Programmer to be installed.

  1. Download and install the latest Quartus Programmer:

  2. Add Quartus programmer to your path:

    export QUARTUS_DIR=<path to qprogrammer install>
    export PATH=$QUARTUS_DIR/qprogrammer/quartus/bin:$PATH
    
  3. Start the jtag daemon:

    sudo killall jtagd
    sudo jtagd
    
  4. Run jtagconfig from the Quartus install, you should see the device(s):

    $ jtagconfig
    1) IA-840F [1-5.2]
      0341B0DD   AGFB027R25A(.|R0)
    
  5. Navigate to the directory containing the jic file:

    cd <vollo-sdk>/bitstream
    
  6. Set the JTAG clock frequency of the device you want to program to 16 MHz. Specify the device by providing the name returned by jtagconfig:

    jtagconfig --setparam "IA-840F [1-5.2]" JtagClock 16M
    
  7. Start the programming operation on the chosen device. This takes around 20 minutes. For the IA840F:

    quartus_pgm -c "IA-840F [1-5.2]" -m JTAG -o "ipv;vollo-ia840f-c3b64.jic"
    

    Or for IA420F:

    quartus_pgm -c "IA-420F [1-5.2]" -m JTAG -o "ipv;vollo-ia420f-c6b32.jic"
    
  8. Go back to 6 and program any other devices.

  9. Power off the system and start it back up. The bitstream will now be loaded onto the FPGA.

    ⚠️ For the configuration process to be triggered the board has to register the power being off. It is recommended to turn the power off and then wait a few seconds before turning the power back on to ensure this happens.

  10. Check a Vollo bitstream is loaded:

    $ lspci -d 1ed9:766f
    51:00.0 Processing accelerators: Myrtle.ai Device 766f (rev 01)
    

    Check the correct Vollo bitstream is loaded:

    cd <vollo-sdk>
    bin/vollo-tool bitstream-check bitstream/<bitstream-name>.json
    

Programming the FPGA via PCIe

NOTE: this can only be done with an FPGA that is already programmed with a Vollo bitstream.

  1. Load the kernel driver:

    sudo ./load-kernel-driver.sh
    
  2. Check the current bitstream information:

    bin/vollo-tool bitstream-info
    
  3. Check that the device is set up for remote system updates by running the command below, with device index representing the index of the device you want to update, in the order shown in the previous command, starting from 0. It should print a json string to the terminal showing the device status.

    bin/vollo-tool fpga-config rsu-status <device index>
    
  4. Update the USER_IMAGE partition of the flash with the new bitstream image contained in the rpd archive in the <vollo-sdk>/bitstream directory. This should take around 5 minutes. Do not interrupt this process until it completes.

    sudo ./load-kernel-driver.sh
    bin/vollo-tool fpga-config overwrite-partition <device index> <.rpd.tar.gz file> USER_IMAGE
    
  5. Repeat step 4 for any other devices you wish to update.

  6. Power off the system and start it back up.

    ⚠️ For the configuration process to be triggered the board has to register the power being off. It is recommended to turn the power off and then wait a few seconds before turning the power back on to ensure this happens.

  7. Repeat steps 1, 2 and 3. The bitstream-info command should show that the updated bitstream has been loaded (e.g. a newer release date), and the output of the rsu-status command should show all zeroes for the error_code and failing_image_address fields.

  8. Check the correct Vollo bitstream is loaded:

    sudo ./load-kernel-driver.sh
    bin/vollo-tool bitstream-check bitstream/<bitstream-name>.json