First Steps

[edit this page] pdf version

It is assumed that you have a pre-configured SERENITY prototype board and access to Vivado software with a connection to the JTAG cable connection on the SERENITY board. Delivered systems will have a “cmx” user account with sudo access, therefore the following commands should work on that given system. Hostnames and specific commands are given as an example.

The SERENITY Prototype board is shown below. One daughter card (DC) site is populated (X1) with a the black heat-sink mounted on the top. The JTAG interface with connections is visible to the top. The ETHERNET connector and ATCA backplane adaptor (power) is mounted on the top right.

Serenity Carrier Card

Accessing the Daughter Card Sites:

  1. There are three methods of accessing the daughter card sites via JTAG:

    • directly from the COM Express (serenitybutler program...) - fastest method

    • via a cable connected to the jtag header (labelled “IPMC”)

    • or remotely through the COM Express (XVC)

Below we describe installation on a standard SERENITY board with embedded system as delivered. There is also a troubleshooting guide which will be expanded as the prototype systems are deployed amongst users.

Most of the configuration is handled by the serenitybutler which is explained in more extensive detail in a cheatsheet reference. For more complete and advanced usage see the SMASH documentation.

Installation (SMASH & EMP)

  1. (optional) open a vivado session (e.g. on greg-special)

    • navigate to Flow -> Open Hardware Manager specific carrier card (jtag end-point)

    • Daughter Card (DC) FPGA should be powered off, therefore no DC connection is visible

  2. Log into the SERENITY host (COM Express)

    • e.g. ssh -X cmx@serenity-2368-04 (also need sudo permission)

  3. Remove existing (legacy) packages in case they exist:

    sudo yum remove "cactuscore-uhal*" "cactusboards-mp7*" "smash*" "cactusboards-emp*" "cactusboards-serenity*"
    sudo yum groups mark remove smash
    sudo yum groups mark remove emp
    sudo yum groups mark remove uhal
    
  4. Download the appropriate YUM repo files, and copy under /etc/yum.repos.d (Requires sudo permission for the account on the SERENITY board and first time needs password):

    sudo curl https://serenity.web.cern.ch/serenity/board-setup/_downloads/ipbus-sw.centos7.repo -o /etc/yum.repos.d/ipbus-sw.repo
    sudo curl https://serenity.web.cern.ch/serenity/board-setup/_downloads/smash.repo -o /etc/yum.repos.d/smash.repo
    sudo curl https://serenity.web.cern.ch/serenity/board-setup/_downloads/emp.repo -o /etc/yum.repos.d/emp.repo
    sudo curl https://serenity.web.cern.ch/serenity/board-setup/_downloads/serenity.repo -o /etc/yum.repos.d/serenity.repo
    sudo curl http://serenity.web.cern.ch/serenity/emp-fwk/_downloads/cactus-build-utils.repo -o /etc/yum.repos.d/cactus-build-utils.repo
    
  5. Install the software (again with sudo rights):

    sudo python3.6 -m pip install --upgrade click==8.0.4 click_didyoumean==0.3.0 pexpect==4.8.0 pytest==7.0.1 pexpect==4.8.0  pyyaml==6.0 python-dateutil==2.8.2 colorama==0.4.5
    sudo yum clean all
    sudo yum groupinstall smash emp uhal
    sudo yum install cactuscore-uhal-python36 smash-python36 "cactusboards-serenity*" python36-rpm cactuscore-build-utils-0.2.9 prometheus-node_exporter
    

The yum install command will check for dependencies so more than three packages will be installed. After checking a confirmation is required (y) to proceed with the installation.

The output looks like this (and choose y if asked):

image of repo package installation

Ends with the satisfying Complete!

You can compare against the latest versions by following the reference Current software and firmware versions, which also describes way to fix any problems.

On the SERENITY baseboard ComX there is typically a cmx shared account and it is important that you create your own filespace under this area. Therefore we suggest a directory using your name or your CERN login (MY_USERNAME):

cd /home/cmx
mkdir MY_USERNAME
cd MY_USERNAME

Power up!

This procedure will switch on a daughter card site.

  1. Environment

    source /opt/cactus/bin/serenity/serenity_env.sh
    
  2. Power on Daughter Card sites using SMASH:

  • If the default SMASH config file variable hasn’t already been set:

    export SMASH_DEFAULT_CONFIG=/path/to/someBoardConfig.smash
    
  • For X0 DC:

    serenitybutler power on x0
    
  • For X1 DC:

    serenitybutler power on x1
    

Here the relevant SMASH commands are issued by the butler script internally. Note that in order for SMASH to function correctly someBoardConfig.smash should point to a configuration file that actually represents the hardware configuration you have on your board. It is suggested to look at the packaged configuration files within /opt/smash/etc/serenity/configuration and adapt accordingly. More details on SMASH are available within the documentation.

Uploading firmware to the daughter cards

If you’re loading a bitfile onto a Serenity daughter card FPGA for the first time, we recommend that you use one of the EMP null algo builds. The EMP framework provides common infrastructural firmware - as well as corresponding control and monitoring software - to support arbitrary user-created payload firmware, e.g. the reconstruction algorithm in a level-1 track finder or level-1 trigger board. In the null algo builds, the data received on each input channel is fed into the corresponding output channel, after several clock cycles. The null algo bitfiles for the latest EMP release can be found here.

The recommended method for uploading firmware to the daughter card FPGAs is to load the bitfile directly from an application running on the COM express, via the Artix-7 FPGA.

Alternately, the daughter card FPGAs can be programmed via a SMASH XVC (Xilinx Virtual Cable) server, which creates a network-based interface for Vivado to access the JTAG connection via the COM express. Finally, if a JTAG programmer cable is connected to the board, that can be used to load bitfiles instead of the ‘direct’ and ‘XVC server’ methods.

Each of these procedures are described below.

After the bitfile has been copied onto the COM express, it can be loaded onto the FPGA using the following Serenity butler command:

export SMASH_DEFAULT_CONFIG=/path/to/someBoardConfig.smash
serenitybutler program SITE /path/to/top.bit

where SITE should be changed to x0 for the FPGA on the X0 site, x1 for X1, or both to program both sites.

By adding a -r flag to this command, i.e:

serenitybutler program SITE /path/to/top.bit -r

it will power cycle the site(s) and reconfigure the clock synthesisers before loading the bitfile.

In the above a path should be provided for the configuration file for SMASH. Examples of pre-existing configurations can be found under /opt/smash/etc/serenity/configuration/ however it is important to have the correct configuration for your actual hardware implementation (e.g. FPGA voltages). In addition it is possible to remove the -c config_file construction from smash.exe commands if you have already set the SMASH_DEFAULT_CONFIG environment variable.

Checking communication with the loaded firmware

In order to check that the firmware was loaded onto the daughter cards successfully, you can run the serenitybutler info command which will print the EMP firmware version registers for each daugther card site, along with version information for the software and the Artix.

If you were loading firmware onto the X1 site, but the X0 site is empty, the output of serenitybutler info should look like:

Software versions
  uHAL:     2.7.9
  EMP:      0.7.2
  SMASH:    0.6.0
  Serenity: 0.3.16

Artix
  FW version: 0.3.2

X0
  No daughter card present
  Power: Disabled

X1
  Power: Enabled
  FPGA: Programmed
  Framework version: 0.3.2 (design 0x42)
  Payload version:   0x12345678

Next Steps:

You can now proceed to understanding the EMP framework and developing an algorithm within the firmware:

  • EMP Framework and the walkthroughs described therein.

  • In addition if you are using a facility test stand then we have created a helpful cheatsheet which includes concise commands for common operations - e.g. power cycling, configuring clock synthesisers and fireflies.