Testing payload firmware in a single FPGA

You can “play” user-defined data through your payload, and capture the output, by following the steps listed below.

Note

In these commands, you will need to replace the following arguments with appropriate values:

  • CONNECTIONS_FILE.xml : Relative/absolute path to your connections file (that specifies the communication protocol and address table files that will be used for each board/FPGA).

  • BOARD_ID : ID string of your board/FPGA in that connections file

  • RX_CHANNEL_LIST: Comma-separated list of input channels (e.g. 4-7,12 for links 4, 5, 6, 7 and 12)

  • TX_CHANNEL_LIST: Comma-separated list of output channels.

    • The list of TX channels does not have to be the same as the list of RX channels - the exact set of channels used depends on the nature of the payload firmware and the overall purpose of the test (e.g. what parts of the algorithm firmware you want to test). However, the payload firmware should set the strobe signal high on all output channels that you will try to capture data from.

  • INPUT_DATA.txt : File containing data that will be loaded into device’s input buffers.

  1. Add the URI and address table for your device to a uHAL connections file (if not done already). For example, for the X1 daughter card on the Serenity, using address table at path/to/addrtab/top_emp.xml, the connections file would be:

    <connections>
      <connection id="x1" uri="ipbuspcie-2.0:///dev/serenity_pcie/x1/h2c,/dev/serenity_pcie/x1/c2h" address_table="file://path/to/addrtab/top_emp.xml" />
    </connections>
    
  2. Setup your environment

    export PATH=/opt/cactus/bin/emp:$PATH
    export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
    
  3. Reset the TTC block

    empbutler -c CONNECTIONS_FILE.xml do BOARD_ID reset internal
    
  4. Load data into the input channels’ buffers, and configure those buffers to inject that data into the payload

    empbutler -c CONNECTIONS_FILE.xml do BOARD_ID buffers rx PlayOnce -c RX_CHANNEL_LIST --inject file://path/to/input_data.txt
    
  5. Configure buffers for the specified output channels to capture data from the payload, then download the data from the input and output buffers.

    empbutler -c CONNECTIONS_FILE.xml do BOARD_ID buffers tx Capture -c TX_CHANNEL_LIST
    empbutler -c CONNECTIONS_FILE.xml do BOARD_ID capture --rx RX_CHANNEL_LIST --tx TX_CHANNEL_LIST
    

    By default, the captured rx/tx data is written to data/rx_summary.txt and data/tx_summary.txt, but that directory can be changed using the -o argument.