NSW pFEB pattern output generation using FELIX guide

This guide is a step-by-step manual on how to generate VMM output according to a PadTrigger pattern input. It assumes pFEB setup is in place. Also, it comments on how to configure a Pad Trigger in order to send data to it from a pFEB.

-- RoyBrener - 2019-08-14

Lorne's "sTGC trigger path integration in Bat 180"

Configure the Pad Trigger

  • Configure the FPGA
  • Set the masks for either 4 pFEbs or one pFEB.
  • Confirm that the LCLC fibre is connected to the correct coupler to the Trigger Processor

Set up the Trigger Processor

  • Confirm that the input fibres are connected
  • Confirm that the FELIX fibre is connected
  • Confirm that the USB cable between FELIX USB and RTM micro-USB is connected
  • Configure the carrier, one emulator and one Trigger Processor mezz

Logging-in and setting-up FELIX user

Login to um-FELIX-SWROD:

  • Account: nswdaq
  • Password: Ask somebody

source /home/setup/setup.sh

Remotely you may access the SWROD computer via ssh as:

ssh -Y nswdaq@um-FELIX2-SWRODNOSPAMPLEASE.cern.ch


Entering the same password.

In terminal, access a FELIX machine:

ssh -Y um-felix1.cern.ch

Set up the hardware

  1. Verify e-link between sFEBs & pFEBs and sTGC L1DDCs
  2. Confirm fans directed towards hardware are on. Don't ever turn them off.
  3. Turn-on the analog and digital power supplies.
    1. on the L1DDCs, confirm green LEDs below the fibre connections are ON.
    2. on the Routers, confirm all seven green power good LEDs near the FEASTs are on
    3. on the Pad Trigger, confirm green LED near the power connector is on
    4. on the Rim-L1DDC, confirm two red power good LEDS near the FEASTs are on, and three green LEDs near the fibre connection is on

In terminal connected to FELIX machine, run setup:

source /home/setup/setup.sh

In case you know of the FELIX to have been restarted, now follow steps under sections Steps that you might need to take from time to time and Steps after you restart the computer in https://twiki.cern.ch/twiki/bin/view/Sandbox/Rongkun_FELIXMan.

Minimum working example

  • General tips
    • When in doubt, restart felixcore and the OPC server
    • When in doubt, kinit

  • [tab 0] Check your hardware connectivity
    • ssh -Y nswdaq@um-felix1
    • flx-info gbt
    • You should see links 0-8 reporting YES
    • If the TP is programmed, link 10 should report YES

  • [tab 0] Check your elinks
    • cd /afs/cern.ch/user/n/nswdaq/public/config-files-sTGC/json_180/PadTrigger_Pattern
    • python config_gbtx.py | grep chunks # to configure the FEB L1DDC
    • Every line of output should report chunks received: 1. If this happens, your elinks are probably good. Do not reconfig. GUIs are error-prone.
    • If there are any chunks received: 0, you have a problem. Proceed to reconfigure elinks.

  • [tab 0] Configure your elinks, only if necessary
    • elinkconfig
    • Click Read Cfg. ALWAYS DO THIS FIRST.
    • Click TH_FO. click None, click OK.
    • Click FH_FO. click None, click OK.
    • Click Clock, click TTC, click OK.
    • Click Open
      • Choose /afs/cern.ch/user/n/nswdaq/public/felix-sw/elinkconfig_files/180_triggerpath_4pfeb_4sfeb_2router_NoReadoutElinks.elc
      • Click Open
      • Click Generate/Upload
      • Click Upload in the E-link Configuration section
      • Click Close
      • Click Quit

  • [tab 1] Start the OPC server
    • ssh -Y nswdaq@um-felix1
    • /home/ScaOpcUa_1.3.2_N/bin/OpcUaScaServer /afs/cern.ch/user/n/nswdaq/public/config-files-sTGC/json_VS/OpcServer_flx1_layer_by_layer_With2Router.xml
    • The OPC server will make a connection to each SCA in your xml. There are 4 pFEBs, 4 sFEBs, and 2 router (2019-10-31)
    • After 10-20 seconds, the server should be in a stable state and producing no text output
    • If repeating messages are printed to screen, you have a problem. The server cannot connect to one or more of the SCAs.
    • You can identify which SCA is being queried by looking for messages like: "Inside netio thread for address: direct/um-felix1.cern.ch/12340/12350/101"
    • Look inside your xml file for that elink, "12340/12350/101"

  • [tab 2] Run the partition
    • ssh -Y nswdaq@um-felix2-swrod
    • cd /afs/cern.ch/user/n/nswdaq/public/db/sTGC_NSW_OKS_Test_DB
    • source setup_oks.sh # setup environment
    • ./kill_part.sh -p sTGC-180-Roy
    • ./run_part.sh -p sTGC-180-Roy
    • The partition will load. It takes 30 seconds or so, please be patient.
    • Right-click on ROX-controller. Click OUT.
    • CONFIG
    • The CONFIG button should create many successfulTransaction messages in [tab 1]. This is the FEB configuration.
    • If you are convinced the configuration worked, press START

  • [tab 3] Check that the router was correctly configured
    • ssh nswdaq@um-felix1-spc
    • cat $(ls -tr /tmp/part_logs/part_NSW-sTGC-180-Roy/NSWConfigApp_um-felix1*.out | tail -n 1)

Configuring GBTxs, fibers and elinks

  1. Setup GBTx for current pFEB test. In the same terminal go to:
cd /afs/cern.ch/user/n/nswdaq/public/config-files-sTGC/json_180/PadTrigger_Pattern

and then run the following scripts:

a python script,

python config_gbtx.py # to configure the FEB L1DDC

and observe that chunks are received. If zero chunks are received - verify electricity and connections of fibers to FELIX & GBTXs on the L1DDCs.

Configure e-links:

  1. In the same terminal run


A GUI opens. Within it verify the following:

  1. click on "read config on the top line.
  2. TH_FO & FH_FO ar"e set to None for all.
  3. Clock coming from TTC.
  4. Setup remaining parameters via pressing Open and fetching one of the following files, depending on your inner paranoia:
    1. /afs/cern.ch/user/n/nswdaq/public/felix-sw/elinkconfig_files/180_triggerpath_4pfeb_4sfeb_1router.elc
    2. /afs/cern.ch/user/n/nswdaq/public/felix-sw/elinkconfig_files/180_triggerpath_4pfeb_4sfeb_1router_NoReadoutElinks.elc

and clicking Generate/Upload....

then click "upload in the E-link configuration section. "Done in blue should appear. Then close and quit.

Verify that the GBTx are configured and the links are locked. For this run

flx-info GBT

The channel numbers you see correspond to the fibers in the FELIX fiber patch panel.

  1. Run felixcore: Open another terminal tab, ssh to the same FELIX, run setup as above. Thereafter run:
felixcore --data-interface=eno1 --elinks=0-500

wait until the log stables and reads "FelixCore Up and Running..."

You can monitor FELIX by opening: http://um-felix1:8080/

FELIX GUI configuration and OPC server run

The GUI should be used in order to overwrite existing configuration and OPC server files. If there are working files at hand which fit your desired configuration, jump to activating the OPC server.

Open another terminal tab, ssh to the same FELIX, run this setup: source /afs/cern.ch/work/r/rowang/public/FELIX/setup_nsw_board_ttc.sh

and then


A GUI opens. On it take the following steps:

  1. Under Config File(s) upload /afs/cern.ch/user/n/nswdaq/public/config-files-sTGC/json_VS/OpcServer_flx1_layer_by_layer_WithRouter.xml
  2. Click Load Config.
  3. Verify the following match your parameters Server IP (often need to be configured to the FELIX in use) Elink ID (according to the enlinkconfig GUI of earlier stage, often 40, 41.) Node ID (the desired pFEB. Format as e.g. sTGC-QS1P1). This must match the VMM channel expected open for pulse on a par with the pattern checked.
  4. Click Write Json File and choose immediate_config.json
  5. Onto loading the pad trigger pattern: Access the tab Pad Trigger Pattern. Load directory where pattern json file is located. Load the pattern file name (without .json). Click Apply Config
  6. Now you can verify the desired VMM channels are open: Make sure the correct pFEB is chosen under the option menu next to Add Board button (e.g. PFEB_0000). Under VMM tab choose the Channel Registers tab. Under VMM Config (ROC Data ID) choose the desired VMM. Check whether the channel/s you expect is/are open. Masking (SM) can be controlled for each channel individually here or collectively under the Pad Trigger Pattern tab.
  7. Writing the OPC server xml file.
Click on Write Opc xml button and choose (overwrite) OpcServer.xml. This will update the configuration onto an xml file according to which the OPC server will be activated. Note however that the actual file produced will automatically be saved with a name header which specifies its host, e.g. OpcServer _um-felix1.cern.ch.xml. This brings us to the next step.

Activating the OPC server: Open a new tab, ssh to the same FELIX, run setup as above. Ensure there is no previous OPC server running by killing it (kill -9 <Opc server process>):

/home/ScaOpcUa_1.3.2_N/bin/OpcUaScaServer /path/to/your/file/<Your Opc Server File.xml>


/home/ScaOpcUa_1.3.2_N/bin/OpcUaScaServer   /afs/cern.ch/user/n/nswdaq/public/config-files-sTGC/json_VS/OpcServer_flx1_layer_by_layer_WithRouter.xml

which would correspond to four sFEBs & four pFEBs.

You should observe the nodes (boards etc.) being checked through the elinks you have set up in the output console. Now the OPC server should be running stably such that no out logs are produced.

Now open the immediate_config.json file as well as the Opc file (which was written) and verify parameters match (like the board, elink).

Partition and root file generation

Upon starting this final stage there are three running processes which must be checked, each should run in a separate terminal tab:

  1. Elinks are configured.
  2. Felix core is running: you should observe the message FelixCore Up and Running
  3. OPC server is running: you should observe the message Press CTRL-C to shutdown server

These confirmed, open a new tab and follow:

cd /afs/cern.ch/user/n/nswdaq/public/db/sTGC_NSW_OKS_Test_DB

In which you should setup the following environment:

source setup_oks.sh # setup environment

  • Verify no previous partition is running by killing:
./kill_part.sh -p <partition process&gt

  • Run your desired partition:
./run_part.sh -p & partition name

Partition GUI should now be up and running.

  • Activate the data acquisition sequence by clicking:
  • Verify data is taken by noticing the Number and Rate panes increasing.
  • Click STOP when enough data has been acquired.
Now the root file can be generated. Open a new terminal and setup as follows:

source /afs/cern.ch/user/r/rowang/FELIX/swROD_NTuple/setup.sh # including setting root env, gcc env, making alias

You can take a look at this file, which sets the analysis environment in place.

  • Navigate to /data/cache and find the latest automatically-produced data file (<binary>.data). Convert it to a root file via the command nsw_process <binary>.data After which you should find the (latest) root file produced in the same directory. Analyse it and make sure the VMM channel you expect to be pulsed is indeed the one activated.

In order to send-out data without writing it to the FELIX SWROD (e.g. in order to check path to Padtrigger) one needs to disable ROX segment in the partition.

  • Right-click on ROX controller
  • Select Out.
  • Verify only the other two are in place.

In order to control the number of fibres and hence elinks pulsed through the partition one needs to follow the following:

  • Access
cd /afs/cern.ch/user/n/nswdaq/public/db/sTGC_NSW_OKS_Test_DB/muons/partitions/

  • Open the file: part_NSW-sTGC-180-Roy.data.xml

In order to observe readout data as a running log, follow the following:

  • In the same OKS directory with the OKS setup.
  • Run the command:
netio_cat  subscribe -e raw -p 12350 -H um-felix1 -t 8 -t 12 -t 16

  • Now you should see logs. If there aren't any, readout data is not sent from server.
Edit | Attach | Watch | Print version | History: r36 < r35 < r34 < r33 < r32 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r36 - 2020-11-15 - AlexanderTuna
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback