Useful Commands

A small number of commonly used SMASH commands are described here such as powering on the daughter cards. More complete and in-depth commands can be found here: Advanced Usage.

Set up the local environment

export LD_LIBRARY_PATH=/opt/cactus/lib:/opt/smash/lib:$LD_LIBRARY_PATH
export SMASH_PATH=/opt/smash
export PATH=/opt/smash/bin:$PATH

In the following commands a configuration/settings file is required in order to define the actual hardware board that is being interrogated/controlled via SMASH - someBoardConfig.smash. This file can define the board configuration (e.g. bindings between components and sockets) as well as settings (e.g. clock or firefly set-up). The directory /opt/smash/etc/serenity/configuration should be investigated in order to see which configurations are available and choose the appropriate one. The choice of daughter card FPGA (DC*) is obviously important along with the Firefly optical connections and whether they are transmit, receive or bi-directional. The basic configuration, BareBoard.smash, is a sensible starting point if you want to control and test components on the base board and can also then be customised according to your actual board. In addition it is possible to remove the -c config_file construction if you have already set the SMASH_DEFAULT_CONFIG environment variable.

SMASH can be run in a number of different ways to facilitate flexible deployment:

  • smash.exe -i option: All the SMASH commands can be run interactively

  • smash.exe "my command1" "my command2": appended in the command-line

  • a default configuration can be applied (obviates the -c filename requirement):

    export SMASH_DEFAULT_CONFIG=/path/to/someBoardConfig.smash
    

It is suggested to read the more complete list within Advanced Usage to understand better the different possibilities of many of the (more powerful) commands.

Sometimes the ARTIX FPGA is not recognised on the PCIe bus therefore the pcie_reconnect script needs to be run at least once:

sudo pcie_reconnect_serenity.sh

If your path is not recognised by sudo then:

sudo /opt/smash/bin/pcie_reconnect_serenity.sh

Common workflows:

Common workflows and the associated SMASH commands are described below. A more exhaustive list and documentation is provided here: Advanced Usage.

Power On or Off both of the processing FPGAs

Note that different daughter cards require slightly different voltages for operation. Automatic reconfiguration of the power supplies depending on the daughter card type is underway, but until it is complete do not swap daughter cards between boards unless you an expert and know how to reconfigure the power supplies.

smash.exe -c /path/to/someBoardConfig.smash "X0:Power On"
smash.exe -c /path/to/someBoardConfig.smash "X0:Power Off"

XVC (Xilinx Virtual Cable)

To connect a DC to the XVC:

  • In interactive mode:

    • JTAGmux Select IPbusJTAG

    • DC0:FPGA Decorate XVC 5000

This can also be included in the configuration script, but note that XVC will only be running as long as smash is open. Alternatively the -b option can be added to the smash.exe command. This “blocking” behaviour will keep XVC running at all times.

Once XVC is running on the ComExpress it is then necessary to tell Vivado how to connect to the virtual cable (through ethernet). This is done using TCL commands which can either be inputed within the console of Vivado or run as a TCL script (tools -> run script). The above XVC Run will output to the screen the necessary lines to execute, e.g.:

open_hw
connect_hw_server
open_hw_target -xvc_url 128.141.YYY.XXX:5000
set current_hw_jtag [get_property hw_jtag [get_hw_target localhost:3121/xilinx_tcf/Xilinx/128.141.YYY.XXX:5000]]

where XXX and YYY are your own unique subnet address. The 3121 is a Vivado default and the 5000 is the port which needs to be open for communication to work.

  • If the XVC fails to connect then there is a chance that the firewall on the ComExpress is somehow blocking it. In which case first check that 5000 is open:

    sudo firewall-cmd --zone=public --list-ports
    

    If port 5000 is not listed then you can first try adding it:

    sudo firewall-cmd --zone=public --add-port=5000/tcp --permanent
    

    But if connection still fails (timeouts) then it is suggested to disable the firewall completely:

    sudo systemctl stop firewalld
    

    Then restart “XVC Run” and re-run the TCL script within Vivado.

Status Checks

The LTM4677 PSUs supply the FPGA transceivers (~1V), optical parts (1.8V) & general I/O (1.8V). The NDM3Zs supply the FPGA core voltage (~1V) and optical parts (3.3V)

smash.exe -c /path/to/someBoardConfig.smash "Foreach type LTM.* Measure .*"
smash.exe -c /path/to/someBoardConfig.smash "Foreach type NDM.* Measure .*"
smash.exe -c /path/to/someBoardConfig.smash "Foreach type .* Validate"

The last command essentially scans the I2CBus to give the result of all connected devices and includes a check on the front-panel LEDs.

25g Firefly Setup

The 25g bi-directional Fireflys have the possiblity of introducing CDR (clock data recovery) which is required for data transmission. However, the have two limited ranges of working:

  • 25.5 - 26.0 GHz - important to set the link to within this range and also set the CDR rate to Lo

  • 27.5 - 28.05 GHz - important to set the link to within this range and also set the CDR rate to Hi

Make sure he has the correct range enabled (below).

  • Hard reset of the Firefly:

    Foreach name biFF.*s  "Hard Reset"
    

    Note that this reset can disturb the PLL lock on the FPGA transceiver so is only advisable before programming the FPGA.

  • Enable the Firefly (both transmit and receive):

    Foreach name biFF.*s "Tx Transmit" 1-4 Enable
    Foreach name biFF.*s "Rx Output" 1-4 Enable
    
  • Enable the CDR:

    Foreach name biFF.*s "Tx CDR" 1-4 Enable
    Foreach name biFF.*s "Rx CDR" 1-4 Enable
    
  • Switch the range of the CDR appropriately:

    Foreach name biFF.*s "Set Tx CDR rate" 1-4 Lo
    Foreach name biFF.*s "Set Rx CDR rate" 1-4 Lo