TRBv1 structure

Word: Contents: Description:
# RPC Header
 
 1        size                    Length of whole subevent 
 2        0x3001                  SubEvt Decoding as 32bit Data
 3        subdetecor-ID           Non-ambiguous ID. Set to 0x221
 4        trigger tag             Trigger tag of subevent
# subEvent

 5        0xbeefTTNW              Internal header, where TT is Trigger Tag and NW is number of words of the subEvent (including header and trailer (0xdeadface)
 6        0x330d701b              first word of event 
          0x........              next word 
          0x........              next word 
 N-1      0x........             (N-5)th word of event  
 N        0xdeadface              last word 
First word of the subEvent is started always as 0xbeefTTNW, and last word is 0xdeadface. 0xbeefTTNW is created by FPGA. 0xbeef and 0xdeadface are only markers, which is usefull to checking by Etrax that data transfer is ok. FPGA is counting how many words belong to each event and put this number as 0xNW. 0xTT is counter of events. Trigger tag of each next event is higher by 1. .... Data word, which is begin from 0x2 is the header, from 0x3 is the trailer, from 0x6 is error, from 0x4 is the data.

We are using two type of measurement:
  1. Leading measurement - Single edge
  2. Leading measurement - Combined measurement of leading and trailing edge (pairing mode)

The datastructure of the long-words from the TDC are described in detail in the HPTDC-manual which is attached (page 24 to 26)

daq_sniff output is something like this:
size: 0x00000134  decoding: 0x00030001  id:    0x00000222  seqNr:  0x000a2e6e  
date: 2005-09-22  time:     20:27:01    runNr: 0x42a1f5ee  expId:              
size: 0x00000114  decoding: 0x00020001  id:    0x00000222  trigNr: 0x0000d7d7

00000000:  0xbeefd741  0x230d7051  0x430058c4  0x43605589 
00000010:  0x43805cc3  0x43f85d6b  0x430858c7  0x43605738 
00000020:  0x43885cc4  0x43c05ec2  0x431058c6  0x43405ac5 
00000030:  0x43905cc5  0x43c85ec2  0x432059c5  0x43485ac5 
00000040:  0x43a05dc3  0x43d05ec2  0x432859c4  0x43505ac6 
00000050:  0x43a85dc4  0x433059c4  0x43605bc1  0x43b05dc2 
00000060:  0x43685bd5  0x43705bd6  0x43605db9  0x330d701b
00000070:  0x230d7051  0x430058f0  0x43605589  0x4390552e 
00000080:  0x43f85d6a  0x430858e6  0x436855c8  0x4380557c 
00000090:  0x43c05ec6  0x431058f0  0x4370557e  0x4388558d 
000000a0:  0x43c85ec7  0x432059e7  0x43405ae9  0x4390556e 
000000b0:  0x43d05ec6  0x432859e7  0x43485ae8  0x438855eb 
000000c0:  0x433059de  0x43505adf  0x43805cc6  0x43605bc4 
000000d0:  0x43905cc6  0x43685bc6  0x43a05dcd  0x43705bc5 
000000e0:  0x43a85dd0  0x43705d3b  0x43b05dcd  0x43885cc6 
000000f0:  0x330d7021  0x240d7051  0x44f85d6e  0x340d7003 
00000100:  0xdeadface

New data-format of the TRB

Experience shows that a fixed data-format never is sufficient for all possible future extensions and ideas. There will be different usages for the TRB with different requirement, so for example we have
  • a request of the LIP-group to put counter-data into the data-stream
  • a bit has to be introduced, which distinguishes between paired mode and edge-modes.
  • for calibration events we have to put the whole configuration bits of the TDC into the data-stream
  • future extensions

Therefore I suggest to extend the data format in the following way:

  • The header should consist of two 32 bit words
  • They should contain:
    • The overall length of the data sent in this event, 16 bit
    • The trigger tag and code
    • If the data contains paired or edge-data
    • A second length (16-bit), which tells the length of the "additional" data
    • a version number of the data structure. It uniquely describes the exact meaning of the "additional" data.

  • The "deadface" at the end of the event, should be optional and possible to be turned off and on by a register in the FPGA.

So it looks like this:

# RPC Header
 
 1        size                    Length of whole subevent 
 2        0x3001                  SubEvt Decoding as 32bit Data
 3        subdetecor-ID           Non-ambiguous ID. Set to 0x221
 4        trigger tag             Trigger tag of subevent
# subEvent

 5        0xTC TT NW NW           Internal header, where TC is the trigger code, TT is Trigger Tag, and NW is number of words of the subEvent (including header and trailer (with optional 0xdeadface), 16 bits, MSB first.

 6        0xVV XX NE NE           Second header word: VV: Version number of data-format, XX: all bits reserved, except the lower most which defines if pairing mode was used, NE: Number of words in the data-extension

 7        0x........              first word of extension data (for example 10 counter values)
 7+1      0x.....
...
...
 7+NE     0x330d701b              TDC data starts here. first word of event, NE word later
          0x........              next word 
          0x........              next word 
 N-1      0x........             (N-1)th word of event  
 N        0xdeadface              last word , optional

-- RadekTrebacz - 22 Sep 2005
Topic revision: r11 - 2007-08-01, MichaelTraxler
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki Send feedback | Imprint | Privacy Policy (in German)