CSM0 Output Format/Options
R. Ball
July 24, 2000
23-July-2000 2
Basic Options
n Current AMT-0 output limited to standard type of
clock and data pairs.
n Many other serial data options still possible.
Search window size, etc.
Data type (edges or combined time over threshold)
n TDC data type sent as first hex character of the
data word
CSM MUST
be programmed to match these
n TDC headers/trailers indicate event boundaries
and must be present
23-July-2000 3
AMT-0 Data Stream
n Upon triggering, AMT-0 sends TDC header word
n Next sends all hits found within match window
Sends in JTAG specified format
TDC channel is encoded within the word
TDC number is known by its RJ45 input jack
n Last of all the TDC trailer word is sent
n For isolated (in time) triggers, all headers arrive at
once at the CSM
n Trailers straggle in depending on number of hits
23-July-2000 4
VME FIFO Event Data
n CSM header is the first word of the event
Written when event trigger fetched from fifo
Hex value = 0x59EEEBBB, EEE=EVID, BBB=BCID
n TDC headers (optional) for all active channels
Leading hex value = 0xaN, N=position on JTAG chain
n TDC data of all active types (JTAG specified)
Nine bits of TDC number/channel replaced by CSM
w TDC 0-15 unchanged
w TDC 16 maps to TDC 0,1,2, channels 24-31
w TDC 17 maps to TDC 4,5,6, channels 24-31
23-July-2000 5
VME FIFO Event Data (2)
n TDC data of an unknown type written without
change.
n TDC trailers (optional) for all active channels
These may be mixed with TDC data of all types
Leading hex value = 0xcN
n CSM trailer is the last word of the event
Written when event trigger fetched from fifo
Hex value = 0x5XEEEBBB, EEE=EVID, BBB=BCID
X=b if event OK, X=d if error occurs
23-July-2000 6
VME FIFO Event Data (3)
n Four bit word types (leading hex character) used
by CSM determined by value in CSM register 3
Default setting of register is 0x535A4C
n Following the CSM trailer, the EVID/ WordCount
register is written with event information
n Complete Event Ready bit is set when valid
EVID/WC value is ready.
23-July-2000 7
Readout Sequence
n Check if Complete Event Ready bit is set
n Read one word from EVID/WC fifo
n Read WC words from VME FIFO
Read one extra word (a zero) if PDT used instead of
block transfer.
23-July-2000 8
MiniDAQ Data Record Format
n Data packed into (max) 1024 word buffers on disk
n Eleven word header at start of buffer
1. Total length of buffer in words
2. Run Number
3. Buffer number
4 and 5 Reserved
6. Number of triggers packed into this buffer
7. Number of data words in buffer (excludes header)
8. ASD threshold
9 and 10 = zero
11. Number of data words in buffer (excludes header)
23-July-2000 9
MiniDAQ Data Record Format
n Words 12 to buffers end are data records.
n Data Record content
1. EVID/WC register content
2-end. Data words from the VME FIFO
n Buffer packing in record ends if too few words
remain for a complete event
#define MIN_AVAIL 256
n End of run forces buffer flush to disk