Skip to content

ETL Test Stand Firmware

Firmware for KCU 105

  • Vivado version: 2021.1

Loading the firmware using programming script

Make sure the JTAG port of the KCU board is connected, and Vivado is properly sourced (e.g., source /media/data_hdd/Xilinx/Vivado/2021.1/settings64.sh on strange.bu.edu). The latest version of the firmware can be obtained from the CLI on gitlab using the get_firmware_zip function:

get_firmware_zip() {
    version=$1
    project="etl_test_fw"
    projectid="107856"

    file=$project-$version.zip
    url=$(curl  "https://gitlab.cern.ch/api/v4/projects/${projectid}/releases/$version" | jq '.description' | sed -n "s|.*\[$project.zip\](\(.*\)).*|\1|p")
    wget $url
    unzip $file
}

Using the above function, the firmware can be downloaded with get_firmware_zip v2.1.11. This will download and unpack the firmware into a directory like etl_test_fw-v2.1.11. Within the directory run source program.sh. The script will list all connected KCU boards. Select the one you want to reprogram (if more than one is found). To program faster you can skip programming the flash.

Loading the firmware using the Vivado GUI

Alternatively, the firmware can be loaded manually by opening Vivado:

  1. Connect JTAG USB connector to computer kcu105_eval_board
  2. Open Hardware manager vivado_startup
  3. Open target -> auto connect. If multiple boards are connected, make sure you select the right one. vivado_opentarget
  4. Right click on xcku and then Program Device. vivado_program_device
  5. Select Bitstream file and [...], and look for the firmware directory (e.g. etl_test_fw-v1.2.3). Select the .bit file and then click Program. (Firmware releases on gitlab)
    • If firmware was loaded correctly, single or double cylon mode should run on the KCU board LEDs vivado_bitstream1 vivado_bitstream2 vivado_bitstream3

Loading the firmware persistently

The KCU105 has a dual Quad-SPI memory which allows a firmware image to be persistently programmed onto the board. The dual configuration allows for programming from two SPI flash memories in parallel (programming 8 bits per clock cycle).

To load the firmware into the flash to keep it even after a power cycle:

  • Right click on FPGA (i.e. xcku), Add Configuration Memory Device vivado_Config_memory_device
  • Scroll down the Select Configuration Memory Part list and search for mt25qu256-spi-x1_x2_x4_x8. Select OK. vivado_mt25
  • Do you want to program the configuration memory device now? OK.
  • In the Program Configuration Memory Device menu:
  • Set Configuration file and Configuration file 2 to the primary and secondary .mcs files
  • Set PRM file and PRM file 2 to the primary and secondary .prm files
  • The default selections of Erase Program, and Verify are ok.
  • Click OK

    vivado_prom_config

Emulator Firmware

  • Quartus 21.1.0
  • Needs a USB blaster. Restart computer with blaster connected if there a troubles with Quartus finding the blaster.

Load firmware

Some instructions can be found here to load the firmware through quartus GUI

  • Start Quartus, open a project and recompile if necessary
  • Start the Programmer, select Add File... and load the default .sof file onto the board, or load a .jic file premanently on flash memory

    quartus_programmer quartus_add_file

To avoid using the GUI one can use the quartus command line tools: Add quartus to your path if you haven't done so, e.g. export PATH=$PATH:/opt/intelFPGA_pro/21.1/quartus/bin/ on strange.bu.edu.

  • To load the .sof file to the emulator board:
quartus_pgm -c 1 -z --mode=JTAG --operation="p;<path/to/file.sof>@1"

where -c specify the blaster to use (useful if you have more then 1 connected at the same time), -z stops the on-chip auto-configuration controller of the device to allow programming via the JTAG interface, which is set with --mode=JTAG. --operation allows to specify the programming operation (p=program) and set the target (@1).

  • to convert a .sof file into a .jic file:
quartus_cpf -c -d MT25QU256 -s 10CX220Y <path/to/file.sof> <path/to/file.jic>

where -c specify the conversion operation, -d MT25QU256 -s 10CX220Y specifies the device name and type.

  • to load the .jic file:
quartus_pgm -c 1 -z --mode=JTAG --operation="ip;<path/to/file.jic>@1"

where the i option in the operation tells the programmer to configure the board after the .jic is loaded on the flash memory

Useful firmware versions

  • Bounce software: for loopback tests and uplink alignment scans gitlab
  • ETROC2 v1 firmware gitlab