Upload and Program bof Files in ROACH1/2

This page list the the methods we use to upload bof files (compiled models) to the ROACHs internal memory and program them to the FPGA.

Uploading ROACH1

You can upload bof files to ROACH1 using the secure copy command (scp) from terminal. You simply do:

scp <bof_path> root@<roach_ip>:/boffiles/

Or you can do it graphically using your favorite file manager software. Here is an example with Ubuntu's Nautilus:

Uploading and Programming ROACH2

The corr package provides a very handy function to upload a bof to the ROACH2 volatile memory and program it in one step. It does not work in ROACH1. In a python eviroment/file:

import corr
fpga = corr.katcp_wrapper.FpgaClient(<roach_ip>)
fpga.upload_program_bof(<bof path>, <upload port, e.g.:3000>)

Uploading ROACH2 Alternative

If the previous method is not working for you, or you want to upload a bof into ROACH2 persistent memory you can use this telnet base method:

  1. Open 2 terminals
  2. Window 1:
    1. Connect to ROACH using telnet:
      • telnet <roach_ip> 7147
    2. Check for list of uploaded bofs:
      • ?listbof
    3. Type:
      1. ?uploadbof 3000 <bof_filename.bof>
      2. DO NOT PRESS ENTER YET
  3. Windows 2:
    1. cd to the directory of the bof file
    2. Type:
      • nc <roach_ip> 3000 < <bof_filename.bof>
  4. Press enter in window 1
  5. Press enter in window 2
  6. Check if upload was successful by `?listbof` and check if the upload file size start with the number around 195...

The netcat (nc) command in the second terminal should be sent immediately after the 'uploadbof' is sent in the first terminal. If the uploading of the bof takes too long or didn't finish correctly, is probably because you need to erase some bofs from the ROACH's memory (try to always have less than 20 bofs in memory).

Update: Good news everyone, I made a script the does the above steps automatically. You can steal it from here. To use it just type in terminal:

python upload_program_roach2.py --ip <roach_ip> --bof <bof_path> --upload --program

Programming General

Provided that the bof file is already in ROACH1 or 2 memory, you simply do:

import corr
fpga = corr.katcp_wrapper.FpgaClient(<roach_ip>)
fpga.progdev(<bof_filename.bof>)