RCE: Advanced Operation

RCE Powertools

This is a collection of scripts for the experts to operate RCE. Non-expert users should refer RCEBasicOp for regular opertions.

Let's begin with:

# login to any np04 computers
ssh np04daq@np04-srv-xxx

# setup environment
source /nfs/sw/rce/setup.sh

Check RCE Status

=== CAUTION === Polling status from RCE during data-taking might case frame dropping. It is recommanded NOT to run this script unless required (e.g. for debugging).

# check status for one RCE (by host name)
rce_status --rce np04-cob1-rce1

# check status for a list of RCEs, seperated by space
rce_status --rce np04-cob1-rce1 np04-cob2-rce3 np04-cob3-rce8

# check status for one COB
rce_status --cob 1

# check status for all RCEs
rce_status --all

WIB-RCE Debugging

This section is for expert who needs to investigate communications between WIB and RCE. Some of the following commands may interrupt data-taking. Always check with slack channel dunscience.slack.com#np04-daq-integration.

Dump RCE data to disk

By default, the script runs in self triggered (software) mode. It reads events from one WIB (connected to 2 RCEs via a COB/DPM QSFP input). It can accept external triggers as well (see "rce_wib_debug -h"). You are required to login to np04-srv-011 to execute "rce_wib_debug" script.

# Must login to np04-srv-011
 ssh np04daq@np04-srv-011

# setup "dev" enviroment
source /nfs/sw/rce/setup.sh dev

# dump data from cob1-dpm1 
rce_wib_debug --cob 1 --dpm 1

Example Output

RunMode: Softwre trigger, RCEs:  ['CERN-110', 'CERN-112']

Accepting triggers for 5 seconds ... (see --timeout option)

[CERN-110] Configuring... OK
[CERN-110] Output file is: CERN-110.dat
Open socket
Got listening socket 4
Listening for a connection on port  7765
Accepted connection from client
SO_RCVBUF   = 00040000
TCP_NODELAY =        0
   Rate        Bps SeqErrs DatErrs BadData Nevents   Total      Bytes
 ------ ---------- ------- --------------- ------- ------- ----------

 ------ NEW EVENT ------

. . . . 
. . . .
. . . .

Trailer: 74cf61ddfad7e6df

 ------ NEW EVENT ------
Stopping pid 17797 ...OK
[CERN-112] Stopping pid 17800 ...OK

Run the following commands to inspect the data ...

PdReaderTest CERN-110.dat | less
PdReaderTest CERN-112.dat | less

Notes

  • Each COBs has 4 DPMs
  • Each DPM contains 2 RCEs
  • The script dump data of 2 RCEs to disk (e.g.. CERN-110.dat, CERN-112.dat).
  • PdReaderTest gives a portion of formatted output of the RCEs data

PdReaderTest Output

Header: 8b309e2205281920
Header      Type.Format = 2.0 N64:052819:2 SubType=2 Bridge=8b309e
Identifier: 000000817f800001 00006dd0ef409d7d
            Format.Type = 1.0 Srcs = 0.0.0 : 1f.7.0
            Timestamp   = 00006dd0ef409d7d Sequence = 00000081
Originator: 00000512
            Software    = 01.00.05.00 Firmware     = 00000048
            RptTag      = 4903
            Serial #    = b10000007effad70
            Location    = np04-sm-1/1/1/2

. . . . .
. . . . .
. . . . .

Wf #  CC Ve Cr.S.F ( Id)   Rsvd  WibErrs         TimeStamp Cvt0 Cvt1
---- -- -- ------------- ------- -------- ---------------- ---- ----
   3: bc 01 1f.7.4 (3fc), 000200 000000ff 00006dd0f778ad6f b4b4 b5b5
   iCd SE Rv  ChkSums  Cvt ErRg Rsvd      Hdrs
   --- -- -- -------- ---- ---- ----  --------
     0 8c 8c 7979f5f5 b4b4 00ff 00fe  aaaaaaaa
Chn 0: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef
Chn10: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef
Chn20: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef
Chn30: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef
   iCd SE Rv  ChkSums  Cvt ErRg Rsvd      Hdrs
   --- -- -- -------- ---- ---- ----  --------
     1 8c 8c 7979f6f6 b5b5 00ff 00fe  aaaaaaaa
Chn 0: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef
Chn10: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef
Chn20: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef
Chn30: 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef 04e4 04fe 0e4f 0fef

Trailer = 74cf61ddfad7e6df
Closing

Decode RCE data

The script unpacks the first event of the files produced above to text files. It requres a fresh login to np04-srv-xxx.

ssh np04daq@np04-srv-xxx

source /nfs/sw/rce/debug/reader/setup

/nfs/sw/rce/debug/reader/bin/rce_decode -f CERN-100.dat

It gives two outputs rce_stream{0, 1}.txt

By default, there are 128 lines (corresponding to the waveform) per each file, i.e the dimension is 128 channels x 10000 ticks.

Remember one WIB -> cob / dpm -> 2 RCEs. Each RCE has two streams (i.e. Two FEMBs)

Debug WIB frame

This script captures one WIB frame from RCE. It can be executed on any np04 node, however, a debug version of rceServer is required

source /nfs/sw/rce/setup.sh dev
rce_wib_debug --cob 1 --dpm 1 --oneshot

Output of a WIB frame

. . . .
. . . .
<DATA020>0x71000070</DATA020>
<DATA021>0x72000071</DATA021>
<DATA022>0x73000072</DATA022>
<DATA023>0x74000073</DATA023>
<DATA024>0x75000074</DATA024>
<DATA025>0x76000075</DATA025>
<DATA026>0x77000076</DATA026>
<DATA027>0x78000077</DATA027>
<DATA028>0x79005e27</DATA028>
<DATA029>0x7a000222</DATA029>
<DATA030>0xff035c3c</DATA030>
<DATA031>0xff035c3c</DATA031>
<DATA032>0xff035c3c</DATA032>
<DATA033>0x10100bc</DATA033>
<DATA034>0x2000001</DATA034>
<DATA035>0x3000002</DATA035>
<DATA036>0x4000003</DATA036>
<DATA037>0x5000004</DATA037>
<DATA038>0x6000005</DATA038>
<DATA039>0x7000006</DATA039>
<DATA040>0x8000007</DATA040>
<DATA041>0x9000008</DATA041>
<DATA042>0xa000009</DATA042>
. . . .
. . . .

Notes

  • Use grep "<Capturing" -B1 -A256 to get the data block
  • The lower 16-bit DATA are deserialized bits (ignore the first 16-bit)
  • A WIB frame starts with pattern "3c5c3c5c3c5cbc". So look for 3 consecutive lines of 0x...5c3c, followed by 0x....bc

-- KaVangTsang - 2017-11-15

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2018-03-05 - KaVangTsang
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CENF All webs login

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