source: firmware/FTM/doc/v5.1/FTM_firmware_specs_v5-1.tex@ 19142

Last change on this file since 19142 was 14288, checked in by vogler, 12 years ago
final version of the FTM firmware docu
File size: 48.9 KB
Line 
1\documentclass[a4paper,11pt]{report}
2
3\usepackage{float}
4\usepackage{graphicx}
5\usepackage{url}
6\usepackage[T1]{fontenc}
7\usepackage{amsmath}
8\usepackage{longtable}
9\usepackage{parskip}
10\usepackage{pifont}
11\usepackage{array}
12
13\setlength{\oddsidemargin}{0cm}
14\setlength{\evensidemargin}{0cm}
15\setlength{\topmargin}{0cm}
16
17\textwidth 6.2in
18\textheight 9in
19\columnsep 0.25in
20
21\pagestyle{plain}
22\setcounter{tocdepth}{1}
23
24\title{\vspace*{-7cm} \Huge \bf FTM Firmware Specifications}
25\author{\Large Patrick Vogler\footnote{Contact for questions and suggestions concerning this
26 document: {\tt patrick.vogler@phys.ethz.ch}}, Quirin Weitzel}
27\date{\vspace*{0.5cm} \Large v5.1~~~-~~~July 2012}
28
29\begin{document}
30
31\maketitle
32
33\newpage
34
35\tableofcontents
36
37%---------------------------------------------------------------------------------
38
39\chapter{Introduction}
40\label{cha:Introduction}
41
42The FTM (FACT Trigger Master) board collects the trigger primitives from all
4340 FTU boards (FACT Trigger Unit) and generates the trigger signal for the
44FACT camera. The trigger logic is a 'n-out-of-40' majority coincidence of all
45trigger primitives. Beside the trigger, the FTM board also generates a
46trigger-ID (see chapter \ref{cha:Trigger-ID}). It is controlled from outside
47via ethernet. Two auxiliary RS-485 interfaces are also available in hardware,
48but not yet supported in firmware.
49
50In addition to the trigger, the FTM board also generates other fast control
51signals: Time-Marker (TIM), DRS \cite{DRS4} reference clock (CLD) and
52reset. These four fast control signals are distributed to the FAD (FACT Analog
53to Digital) boards via two FFC (FACT Fast Control) boards. The FTM board also
54provides, via the TIM line, the signal for the DRS timing calibration. In order
55to generate the CLD DRS reference clock, as well as the time-marker signal for
56DRS timing calibration, the FTM board uses a clock conditioner
57\cite{LMK03000}.
58
59The FTM board has two time counters, the 'timestamp counter' and the 'on-time
60counter'. While the 'timestamp counter' runs continuously, the 'on-time
61counter' only counts when the camera trigger is enabled, i.e. when no FAD board
62is busy and not during the dead time. Both counters are reset at the beginning and
63at the end of a run.
64
65The FTM board further serves as slow control master for the 40 FTU boards. The
66slow control of the FTU boards and the distribution of the trigger-ID to the
67FAD boards are performed via dedicated RS-485 buses. Because the FAD as well
68as the FTU boards are arranged in crates of 10 boards each, the FTM board has
69four connectors, one for each crate. Running over these connectors there are
70two RS-485 buses (one for FTU slow control and one for the trigger-ID) besides
71the busy signal from the FAD boards and the crate reset.
72
73In addition, the FTM board controls the two FLPs (FACT Light Pulser) via four
74LVDS signals each. Light pulser~1 (also known as `external lightpulser`) is
75located in the mirror dish, light pulser~2 (also known as `internal lightpulser`)
76inside the camera shutter. There are also digital auxiliary in- and
77outputs according to the NIM (Nuclear Instrumentation Module) standard, for
78example for external triggers and veto, and to have the signals accessible.
79
80The main component of the FTM board is a FPGA (Xilinx Spartan
81XC3SD3400A-4FGG676C), fulfilling the main functions within the board. The
82purpose of this document is to provide specifications needed for the
83understanding of the firmware of this FPGA and the software (called 'FTMcontrol'
84in the following) controlling the FTM board. For further information about the
85FTM board hardware please refer to \cite{FTM-Schematics}.
86
87\chapter{Trigger-ID}
88\label{cha:Trigger-ID}
89
90For each processed trigger the FTM board generates a unique trigger-ID to be
91broadcasted to all FAD boards and added to the event data. This trigger-ID
92consists of a 32 bit trigger number, a two byte trigger type indicator and a
93checksum. The transmission protocol for the trigger-ID broadcast is shown in
94table \ref{tab:Trigger-ID broadcast}.
95
96\begin{table}[htbp]
97\centering
98\begin{tabular}{|l|l|}\hline
99byte no & content\\\hline\hline
1000 & Trigger-No first byte (least significant byte) \\\hline
1011 & Trigger-No second byte\\\hline
1022 & Trigger-No third byte\\\hline
1033 & Trigger-No forth byte (most significant byte)\\\hline
1044 & Trigger-Type 1\\\hline
1055 & Trigger-Type 2\\\hline
1066 & CRC-8-CCITT (checksum)\\\hline
107\end{tabular}
108\caption{The transmission protocol to broadcast the trigger-ID to the FAD boards}
109\label{tab:Trigger-ID broadcast}
110\end{table}
111
112A Cyclic Redundancy Check (CRC) over byte 0 - 5 is used to evaluate the
113integrity of the trigger-ID. An 8-CCITT CRC has been chosen which is based on
114the polynomial $x^8 + x^2 + x + 1$ (00000111, omitting the most significant
115bit). The resulting 1-byte checksum comprises the last byte of the trigger-ID.
116The transmission of the trigger-ID to the FAD boards is done by means of
117dedicated RS-485 buses (one per crate).
118
119In the first byte of the trigger type indicator (see table
120\ref{tab:Trigger-Type 1}) n0 - n5 indicate the number of trigger primitives
121required for a trigger, thus the 'n' of the 'n-out-of-40' majority
122coincidence. The two flags 'external trigger 1' and 'external trigger 2',
123when set, indicate a trigger from the corresponding NIM inputs. See also
124section \ref{sec:Static-data-block} and table \ref{tab:FTM-majority} for
125further information.
126
127\begin{table}[htbp]
128\centering
129%\begin{small}
130\begin{tabular}{|l|l|l|l|l|l|l|l|}\hline
131 Bit7 & Bit6 & Bit5 & Bit4 & Bit3 & Bit2 & Bit1 & Bit0\\\hline\hline
132 n5 & n4 & n3 & n2 & n1 & n0 & external trigger 2 & external trigger 1\\\hline
133\end{tabular}
134%\end{small}
135\caption{Trigger-Type 1}
136\label{tab:Trigger-Type 1}
137\end{table}
138
139\begin{table}[htbp]
140\centering
141\begin{small}
142\begin{tabular}{|l|l|l|l|l|l|l|l|}\hline
143Bit7 & Bit6 & Bit5 & Bit4 & Bit3 & Bit2 & Bit1 & Bit0\\\hline\hline
144TIM source & LP\_set\_3 & LP\_set\_2 & LP\_set\_1 & LP\_set\_0 & pedestal & LP\_2 & LP\_1\\\hline
145\end{tabular}
146\end{small}
147\caption{Trigger-Type 2}
148\label{tab:Trigger-Type 2}
149\end{table}
150
151The 'TIM source' bit in 'Trigger-Type 2' (see table \ref{tab:Trigger-Type 2})
152indicates the source of the timemarker signal: a '0' indicates the timemarker
153being produced in the FPGA while a '1' indicates the timemarker coming from
154the clock conditioner. The flags 'LP\_1' and 'LP\_2' are set when the
155corresponding lightpulser has flashed while the 'pedestal' flag is set in case
156of a pedestal (random) trigger. An event having none of these flags set
157indicates a physics event.
158% The bits 'LP\_set\_0' to 'LP\_set\_3' are used to
159% code information about the light pulser settings. They only have a meaning in
160% case of calibration events.
161The bits 'LP\_set\_0' to 'LP\_set\_3' can be used in the future to
162code information about the light pulser settings. They only have a meaning in
163case of calibration events, but are not yet filled by the firmware (only zeros).
164
165
166\chapter{FTM Commands}
167\label{cha:FTM-Commands}
168
169The communication between the FTM board and the FTMcontrol software, including
170the corresponding commands, protocols and data, is based on 16-bit words and
171big-endian. This is to facilitate the data-transmission over the Wiznet W5300
172ethernet interface \cite{W5300}.
173
174The basic structure of all commands is the same and given in table
175\ref{tab:FTM-command-structure}. After a start delimiter, the second word
176identifies the command. Next there is a parameter further refining the
177command, e.g. what to read. The fourth and fifth words are spares and should
178contain zeros only. Starting from the sixth word, an optional data block of
179variable size is following. This data block differs in length and content
180depending on command and parameter. In case of 'read' instructions, the
181corresponding data block is sent back.
182
183%The FTM board must answer every command by sending back the appropriate data
184%block or by simply sending back the instruction where there is no datablock to
185%be sent back. All 'read' commands to the FTM board do not contain any data
186%blocks, but the FTM boards response does. In case of 'read' and 'write'
187%instructions, the datablock is to be sent back. When 'start run' or 'stop run'
188%commands are used, the FTM board 'mirrors' them, i.e. sends them back for
189%confirmation.
190
191\begin{table}[p]
192\centering
193\begin{tabular}{|l|l|}\hline
194 word no & content\\\hline\hline
195 0 & start delimiter ('@') \\\hline
196 1 & command ID \\\hline
197 2 & command parameter \\\hline
198 3 & spare: containing 0x0000\\\hline
199 4 & spare: containing 0x0000 \\\hline
200 5 & data block (optional and of variable size)\\\hline
201 ... & ...\\\hline
202 X & data block\\\hline
203\end{tabular}
204\caption{FTM command structure}
205\label{tab:FTM-command-structure}
206\end{table}
207
208So far eight different commands are foreseen: 'read', 'write', 'start run',
209'stop run', 'ping FTUs', 'crate reset', 'autosend on/off' and 'config single FTU' (see table
210\ref{tab:FTM-command-ID}). The command parameters of the 'read' and 'write'
211commands are shown in table~\ref{tab:FTM-read-command-param} and
212table~\ref{tab:FTM-write-command-param}, respectively. With the 'autosend
213on/off' command it is possible to switch off the automatic sending of trigger
214rates and error messages (see table~\ref{tab:FTM-as-command-param}).
215
216The 'config single FTU' command has as its parameters a crate and a board number
217as it is shown in table~\ref{tab:FTM-cfsingleFTU-command-param}.
218Before the 'config single FTU' command can be meaningfully executed, the corresponding
219data has to be written into the static data block (see section~\ref{sec:Static-data-block}),
220using e.g. 'write single address' commands.
221The 'config single FTU' command then writes the new configuration to the corresponding FTU board,
222even if a run is ongoing.
223
224\begin{table}[p]
225\centering
226\begin{tabular}{|r|r|}\hline
227 command-ID: bits & \\\cline{1-1}
228 15 ... 8 \vline 7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command\\\hline\hline
229 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 & read \\\hline
230 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 & write \\\hline
231 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 & start run / take X events\\\hline
232 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 \vline 0 & stop run \\\hline
233 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 \vline 0 \vline 0 & ping all FTUs \\\hline
234 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 & crate reset \\\hline
235 0 \vline 0 \vline 1 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 & autosend on/off \\\hline
236 0 \vline 1 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 & config single FTU \\\hline
237\end{tabular}
238\caption{FTM command ID listing}
239\label{tab:FTM-command-ID}
240\end{table}
241
242\begin{table}[p]
243\centering
244\begin{tabular}{|r|r|r|}\hline
245 command parameter: bits & & \\\cline{1-1}
246 15 ... 8 \vline 7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command & data block\\\hline\hline
247 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 & read complete static data block & no\\\hline
248 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 & read complete dynamic data block & no\\\hline
249 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 & read single address of static data block & address\\\hline
250 %0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 & read trigger list & no\\\hline
251\end{tabular}
252\caption{Command parameters for the 'read' command; only for the static data
253 block single addresses can be read.}
254\label{tab:FTM-read-command-param}
255\end{table}
256
257\begin{table}[p]
258\centering
259\begin{tabular}{|r|r|r|}\hline
260 command parameter: bits & & \\\cline{1-1}
261 15 ... 8 \vline 7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command & data block\\\hline\hline
262 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 & write complete static data block & all configuration data\\\hline
263 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 & write single address of static data block & address + data\\\hline
264\end{tabular}
265\caption{Command parameters for the 'write' command; only the static data
266 block can be written, therefore parameter value 0x2 is not used.}
267\label{tab:FTM-write-command-param}
268\end{table}
269
270\begin{table}[p]
271\centering
272\begin{tabular}{|r|r|r|}\hline
273 command parameter: bits & & \\\cline{1-1}
274 15 ... 8 \vline 7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command & data block\\\hline\hline
275 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 & reports disabled & no\\\hline
276 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 & reports enabled & no\\\hline
277\end{tabular}
278\caption{Command parameters for the 'autosend on/off' command}
279\label{tab:FTM-as-command-param}
280\end{table}
281
282
283
284\begin{table}[p]
285\centering
286\begin{tabular}{|c|c|c|c|c|c|}\hline
287\multicolumn{4}{|c|}{command parameter: bits} & \multicolumn{2}{c|}{ }\\\hline %cline{1-1}
288 15 ... 11 & 10 ... 8 & 7 ... 2 & 1 ... 0 & command & data block\\\hline\hline
289 0 & slot no & 0 & crate no & configure FTU & no\\\hline
290\end{tabular}
291\caption{Command parameters for the 'config single FTU' command}
292\label{tab:FTM-cfsingleFTU-command-param}
293\end{table}
294
295
296%\begin{table}[htbp]
297%\centering
298%\begin{tabular}{|r|r|r|}\hline
299% command parameter: bits & & \\\cline{1-1}
300% 15 ... 8 \vline 7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command & data block\\\hline\hline
301% 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline0 \vline 0 \vline0 \vline1 & write static data & static data block\\\hline
302%\end{tabular}
303%\caption{Command parameters for the 'write' command}
304%\label{tab:FTM-write-command-param}
305%\end{table}
306
307In table \ref{tab:FTM-start-command-param} the parameters to start a run are
308listed. The type of the run is fully described in the FTM configuration
309(static data block, see section~\ref{sec:Static-data-block}), which always has
310to be sent by the FTMcontrol before starting a run. Therefore the only
311option is to start an "endless" run or to take X events (Not yet implemented in firmware) instead.
312In the latter
313case X is defined by a two words (32 bit) long unsigned integer, making up the
314command data block. The 'start run' command enables the transmission of
315trigger signals (physics, calibration or pedestal) to the FAD boards and
316resets the trigger and time counters. There is no parameter for stopping a
317run. If a number of events has been specified ('take X events'), the run will
318terminate if either the 'stop run' command is received or the requested number
319of events is reached. In any case the trigger and time counters are reset,
320too.
321
322\begin{table}[p]
323\centering
324\begin{tabular}{|r|r|r|}\hline
325 command parameter: bits & & \\\cline{1-1}
326 15 ... 8 \vline7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command & data block\\\hline\hline
327 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 & start run & no \\\hline
328 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 & take X events & number of events X \\\hline
329 %0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 & start taking pedestals & no \\\hline
330 %0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 1 & take X pedestals events & number of events X \\\hline
331 %0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 \vline 0 & start calibration run & no \\\hline
332 %0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 \vline 1 & take X calibration events & number of events X \\\hline
333\end{tabular}
334\caption{Command parameters for the 'start run' command: "start run" means an
335 "endless" run, i.e. no pre-defined number of events; if a number of events X
336 is specified, this is done with a 32-bit unsigned long integer (big endian).}
337\label{tab:FTM-start-command-param}
338\end{table}
339
340%\begin{table}[htbp]
341%\centering
342%\begin{tabular}{|r|r|r|}\hline
343% command parameter: bits & & \\\cline{1-1}
344% 15 ... 8 \vline 7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command & data block\\\hline\hline
345% 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 & stop run & no\\\hline
346%\end{tabular}
347%\caption{Command parameter for the 'stop run' command}
348%\label{tab:FTM-stop-command-param}
349%\end{table}
350
351In case of a 'ping FTUs' command the FTM will address the FTUs one by one and
352readout their DNA. The results are collected in the FTU list (see section
353\ref{sec:FTU-List}), which is sent back to the FTMcontrol. There are no
354parameters for this command. With the 'crate reset' command the FTU and FAD boards of a
355particular crate are rebooted (only the FPGAs), where the command parameter defines the
356crate number (see table \ref{tab:FTM-reset-command-param}). Only one crate
357reset at a time is possible, i.e. the FTM firmware does not allow to reset
358multiple crates in one command.
359
360\begin{table}[p]
361\centering
362\begin{tabular}{|r|r|r|}\hline
363 command parameter: bits & & \\\cline{1-1}
364 15 ... 8 \vline 7 \vline 6 \vline 5 \vline 4 \vline 3 \vline 2 \vline 1 \vline 0 & command & data block\\\hline\hline
365 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 & reset crate 0 & no\\\hline
366 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 & reset crate 1 & no\\\hline
367 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 & reset crate 2 & no\\\hline
368 0 \vline 0 \vline 0 \vline 0 \vline 0 \vline 1 \vline 0 \vline 0 \vline 0 & reset crate 3 & no\\\hline
369\end{tabular}
370\caption{Command parameters for the 'crate reset' command: the command parameter may only contain a single "1"
371 corresponding to only one crate reset at a time.}
372\label{tab:FTM-reset-command-param}
373\end{table}
374
375\chapter{FTM data blocks}
376\label{cha:FTM-data-block}
377
378The trigger master features two main data blocks, named 'static data block'
379and 'dynamic data block' in the following. They are implemented in the
380firmware as block-RAM. In addition, there is the so-called 'FTU list', which
381is filled only on request ('ping FTUs' command). If any of these blocks is
382sent to the FTMcontrol (either automatically or on demand), a header with a
383size of 14 words is added, and the whole data package is put between a start
384and an end delimiter (see table~\ref{tab:FTM-package}). The header is
385identical for all data blocks and contains solely read-only information: the
386type and length of the package, the FTM status, the FTM board ID (57-bit
387Xilinx device DNA \cite{ds557, ds610, wp267, wp266}), a firmware ID and the
388readings of the trigger counter and time stamp counter since last reset (see
389table~\ref{tab:FTM-header}).
390
391\begin{table}[h]
392\centering
393\begin{tabular}{|c|c|c|c|}\hline
394 start delimiter & header & data block & end delimiter \\\hline
395 0xFB01 & 14 words & optional size & 0x04FE\\\hline
396\end{tabular}
397\caption{Structure of a data package as sent by the FTM to the FTMcontrol
398 software. The start and end delimiters are the same as used for the FAD boards.}
399\label{tab:FTM-package}
400\end{table}
401
402\begin{table}[h!]
403\centering
404\begin{tabular}{|l|l|c|}\hline
405 word no & content & description\\\hline\hline
406 0x000 & type of data package & 1: SD, 2: DD, 3: FTU-list, 4: error, 5: single SD-word\\\hline
407 0x001 & length of data package & after header, including end delimiter\\\hline
408 0x002 & status of FTM & see table \ref{tab:STATUS}\\\hline
409 0x003 & board ID bits 63...48 & FPGA device DNA\\\hline
410 0x004 & board ID bits 47...32 & FPGA device DNA\\\hline
411 0x005 & board ID bits 31...16 & FPGA device DNA\\\hline
412 0x006 & board ID bits 15... 0 & FPGA device DNA\\\hline
413 0x007 & firmware ID & defined as a VHDL constant\\\hline
414 0x008 & trigger counter bits 31...16 & at read-out time\\\hline
415 0x009 & trigger counter bits 15... 0 & at read-out time\\\hline
416 0x00A & time stamp bits 63...48 & filled up with zeros\\\hline
417 0x00B & time stamp bits 47...32 & at read-out time\\\hline
418 0x00C & time stamp bits 31...16 & at read-out time\\\hline
419 0x00D & time stamp bits 15... 0 & at read-out time\\\hline
420\end{tabular}
421\caption{Header structure for sending a data block or error message, wherq
422 'SD' stands for the static data block and `DD' for the dynamic
423 data block.}
424\label{tab:FTM-header}
425\end{table}
426
427In table \ref{tab:STATUS} the encoding of the status of the FTM is shown.
428
429\begin{table}[h]
430\centering
431\begin{tabular}{|c|c|}\hline
432 status & value \\\hline\hline
433 IDLE\_NOT\_LOCKED & 0x0001\\\hline
434 CONFIG & 0x0002 \\\hline
435 RUNNING\_NOT\_LOCKED & 0x0003\\\hline
436 IDLE & 0x0101\\\hline
437 RUNNING & 0x0103\\\hline
438\end{tabular}
439\caption{Encoding of the status of the FTM board in the header.
440 In this context `LOCKED` means that the PLL of the Clock
441 conditioner \cite{LMK03000} is locked.}
442\label{tab:STATUS}
443\end{table}
444
445
446\section{Static data block}
447\label{sec:Static-data-block}
448
449The static data block contains all the settings needed to configure and
450operate the FTM. It has to be written by the FTMcontrol each time before a run
451is started or, in general, some component has to be reprogrammed. In
452addition, whenever the FTM board receives a new static data block, it performs
453a complete reconfiguration including a reprogramming of the FTUs.
454As an exception, the clock conditioner is only reprogrammed, if its settings
455really changed. When a new static data block is received during a run, it
456is written to the memeory, but subsequently ignored.
457Table~\ref{tab:FTM-trigger-master-static-data-block} summarizes the
458static data block. More details about the individual registers can be found in
459the subsequent tables.
460
461%These settings are readable and writable by the main control using the
462%corresponding commands 'read static data block' or 'write static data block',
463%respectively. There is one exception from writability: In case the static
464%data block is read back, the first eleven words (address 0..A) are identical
465%with the dynamic data block and the trigger list shown in
466%\ref{tab:FTM-trigger-master-dynamic-data-block} and
467%\ref{tab:FTM-trigger-list}. These first eleven words can only be read and not
468%written. The board ID is supposed to be the Xilinx device DNA \cite{ds557,
469% ds610, wp267, wp266}, the 57 bit device ID of the FPGA. When using the
470%'write static data block' command, the static data block must start with the
471%'general settings register' at address 0x00B. So there is an offset in the
472%addresses of 0x00B between the 'read-out-version' and the 'write-version' of
473%the static data block.
474
475\begin{longtable}[h]{|l|l|c|}\hline
476\centering
477word no & content & description\\\hline\hline
4780x000 & general settings & see table~\ref{tab:FTM-general-settings-register} and text\\\hline
4790x001 & on-board status LEDs & see table~\ref{tab:FTM-LED-register}\\\hline
4800x002 & light pulser and pedestal trigger period & see table~\ref{tab:FTM-frequency-register} and text\\\hline
4810x003 & sequence of LP1, LP2 and PED triggers & see table~\ref{tab:FTM-ratio-register} and text\\\hline
482
4830x004 & light pulser 1 amplitude & see table~\ref{tab:LP1-amplitude-register} and text\\\hline
4840x005 & light pulser 2 amplitude & see table~\ref{tab:LP2-amplitude-register} and text\\\hline
4850x006 & light pulser 1 delay & 8ns + delay value*4ns\\\hline
4860x007 & light pulser 2 delay & 8ns + delay value*4ns\\\hline
487
4880x008 & majority coincidence n (for physics) & see table~\ref{tab:FTM-majority} and text\\\hline
4890x009 & majority coincidence n (for calibration) & see table~\ref{tab:FTM-majority} and text\\\hline
4900x00A & trigger delay & 8ns + delay value*4ns, 10 bits used\\\hline
4910x00B & timemarker delay & 8ns + delay value*4ns, 10 bits used\\\hline
4920x00C & dead time & 8ns + value*4ns, 16 bits used\\\hline
4930x00D & clock conditioner R0 bits 31...16 & \\\hline
4940x00E & clock conditioner R0 bits 15...0 & \\\hline
4950x00F & clock conditioner R1 bits 31...16 & \\\hline
4960x010 & clock conditioner R1 bits 15...0 & \\\hline
4970x011 & clock conditioner R8 bits 31...16 & \\\hline
4980x012 & clock conditioner R8 bits 15...0 & \\\hline
4990x013 & clock conditioner R9 bits 31...16 & \\\hline
5000x014 & clock conditioner R9 bits 15...0 & \\\hline
5010x015 & clock conditioner R11 bits 31...16 & \\\hline
5020x016 & clock conditioner R11 bits 15...0 & \\\hline
5030x017 & clock conditioner R13 bits 31...16 & \\\hline
5040x018 & clock conditioner R13 bits 15...0 & \\\hline
5050x019 & clock conditioner R14 bits 31...16 & \\\hline
5060x01A & clock conditioner R14 bits 15...0 & \\\hline
5070x01B & clock conditioner R15 bits 31...16 & \\\hline
5080x01C & clock conditioner R15 bits 15...0 & \\\hline
5090x01D & maj. coinc. window (for physics) & 8ns + value*4ns, 4 bits used\\\hline
5100x01E & maj. coinc. window (for calibration) & 8ns + value*4ns, 4 bits used \\\hline
5110x01F & spare & \\\hline
5120x020 & enables patch 0 board 0 crate 0 & see FTU documentation\\\hline
5130x021 & enables patch 1 board 0 crate 0 & see FTU documentation\\\hline
5140x022 & enables patch 2 board 0 crate 0 & see FTU documentation\\\hline
5150x023 & enables patch 3 board 0 crate 0 & see FTU documentation\\\hline
5160x024 & DAC$\_$A board 0 crate 0 & see FTU documentation \\\hline
5170x025 & DAC$\_$B board 0 crate 0 & see FTU documentation \\\hline
5180x026 & DAC$\_$C board 0 crate 0 & see FTU documentation \\\hline
5190x027 & DAC$\_$D board 0 crate 0 & see FTU documentation \\\hline
5200x028 & DAC$\_$H board 0 crate 0 & see FTU documentation \\\hline
5210x029 & Prescaling board 0 crate 0 & (value+1)/2~[s], also autosend period \\\hline
5220x02A & enables patch 0 board 1 crate 0 & see FTU documentation \\\hline
5230x02B & enables patch 1 board 1 crate 0 & see FTU documentation \\\hline
5240x02C & enables patch 2 board 1 crate 0 & see FTU documentation \\\hline
5250x02D & enables patch 3 board 1 crate 0 & see FTU documentation \\\hline
5260x02E & DAC$\_$A board 1 crate 0 & see FTU documentation \\\hline
5270x02F & DAC$\_$B board 1 crate 0 & see FTU documentation \\\hline
5280x030 & DAC$\_$C board 1 crate 0 & see FTU documentation \\\hline
5290x031 & DAC$\_$D board 1 crate 0 & see FTU documentation \\\hline
5300x032 & DAC$\_$H board 1 crate 0 & see FTU documentation \\\hline
5310x033 & Prescaling board 1 crate 0 & see FTU documentation \\\hline
532... & ... & \\\hline
5330x1A6 & enables patch 0 board 9 crate 3 & see FTU documentation \\\hline
5340x1A7 & enables patch 1 board 9 crate 3 & see FTU documentation \\\hline
5350x1A8 & enables patch 2 board 9 crate 3 & see FTU documentation \\\hline
5360x1A9 & enables patch 3 board 9 crate 3 & see FTU documentation \\\hline
5370x1AA & DAC$\_$A board 9 crate 3 & see FTU documentation \\\hline
5380x1AB & DAC$\_$B board 9 crate 3 & see FTU documentation \\\hline
5390x1AC & DAC$\_$C board 9 crate 3 & see FTU documentation \\\hline
5400x1AD & DAC$\_$D board 9 crate 3 & see FTU documentation \\\hline
5410x1AE & DAC$\_$H board 9 crate 3 & see FTU documentation \\\hline
5420x1AF & Prescaling board 9 crate 3 & see FTU documentation \\\hline
5430x1B0 & active FTU list crate 0 & see FTU documentation \\\hline
5440x1B1 & active FTU list crate 1 & see FTU documentation \\\hline
5450x1B2 & active FTU list crate 2 & see FTU documentation \\\hline
5460x1B3 & active FTU list crate 3 & see FTU documentation \\\hline
547\caption{Overview of the FTM static data block}
548\label{tab:FTM-trigger-master-static-data-block}
549\end{longtable}
550
551The FTM general settings register is detailed in table
552\ref{tab:FTM-general-settings-register}. The 'TIM\_CLK' bit defines whether
553the time marker is generated by the FPGA ('TIM\_CLK' = 0, default for physics
554data taking), or whether it is generated by the clock conditioner ('TIM\_CLK'
555= 1, e.g. for DRS timing calibration). The 'ext\_veto', 'ext\_trig\_1' and
556'ext\_trig\_2' bits enable (1) or disable (0) the NIM inputs for the external
557veto and trigger signals, respectively. In order to select which trigger
558sources are active during a run, the bits 'LP1', 'LP2', 'ped' and 'trigger'
559are foreseen (0 disabled, 1 enabled). During a physics run, for example,
560'LP1', 'ped' and 'trigger' should all be set to generate interleaved
561calibration and pedestal events as well as activate the 'n-out-of-40' trigger
562input. For a didicated pedestal run only 'ped' should be set, since in this
563case the FTM sends directly a trigger to the FADs. For calibration runs it
564depends on whether the external (LP1) or internal (LP2) light pulser is used:
565For the first case 'LP1' and 'trigger' have to be set, since here the full
566trigger chain is involved and the camera triggers based on G-APD signals.
567For the second case only 'LP2' is needed, because the shutter is closed and the
568FTM sends the trigger signal directly to the FADs (like for pedestal
569events). Bits 8 to 15 of the general settings register are not used up to now.
570
571
572\begin{table}[h]
573\centering
574\begin{small}
575\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}\hline
576Bit & 15...8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\\hline
577Content & x & trigger & ped & LP2 & LP1 & ext\_trig\_2 & ext\_trig\_1& ext\_veto & TIM\_CLK \\\hline
578\end{tabular}
579\end{small}
580\caption{FTM general settings register}
581\label{tab:FTM-general-settings-register}
582\end{table}
583
584%\begin{table}[!h]
585%\centering
586%\begin{tabular}{|l|l|}\hline
587%TIM\_CClk & description \\\hline\hline
588%0 & Time marker generated in the FPGA \\\hline
589%1 & Time marker generated by the clock conditioner \\\hline
590%\end{tabular}
591%\caption{FTM Time marker indication}
592%\label{tab:FTM-Time-marker-indication}
593%\end{table}
594
595%\begin{table}[!h]
596%\centering
597%\begin{tabular}{|l|l|}\hline
598%ena$\_$ext$\_$Veto & description \\\hline\hline
599%0 & disable external trigger veto\\\hline
600%1 & enable external trigger veto \\\hline
601%\end{tabular}
602%\caption{FTM external trigger}
603%\label{tab:FTM-external-trigger}
604%\end{table}
605
606%\begin{table}[!h]
607%\centering
608%\begin{tabular}{|l||l|}\hline
609%ena\_LP1 & description \\\hline\hline
610%0 & disable light pulser 1 \\\hline
611%1 & enable light pulser 1\\\hline
612%\end{tabular}
613%\caption{FTM light pulser 1}
614%\label{tab:FTM-light-pulser-1}
615%\end{table}
616
617%\begin{table}[!h]
618%\centering
619%\begin{tabular}{|l||l|}\hline
620%ena\_LP2 & description \\\hline\hline
621%0 & disable light pulser 2 \\\hline
622%1 & enable light pulser 2 \\\hline
623%\end{tabular}
624%\caption{FTM light pulser 2}
625%\label{tab:FTM-light-pulser-2}
626%\end{table}
627
628%\begin{table}[!h]
629%\centering
630%\begin{tabular}{|l||l|}\hline
631%ena\_Ped & description \\\hline\hline
632%0 & disable interleaved pedestal trigger \\\hline
633%1 & enable interleaved pedestal trigger \\\hline
634%\end{tabular}
635%\caption{FTM interleaved pedestals}
636%\label{tab:FTM-interleaved-pedestals}
637%\end{table}
638
639%\begin{table}[!h]
640%\centering
641%\begin{small}
642%\begin{tabular}{|l||l|}\hline
643%ena\_LLC & description \\\hline\hline
644%0 & disable low level calibration pulses \\\hline
645%1 & enable low level calibration pulses \\\hline
646%\end{tabular}
647%\end{small}
648%\caption{FTM low level calibration pulses}
649%\label{tab:FTM-low-level-calibration-pulses}
650%\end{table}
651
652The 'on-board status LEDs' register shown in table \ref{tab:FTM-LED-register}
653allows to switch a total of eight LEDs on the FTM board for debugging purposes
654by setting the corresponding bit high.
655
656\begin{table}[h]
657\centering
658\begin{small}
659\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}\hline
660Bit & 15...8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\\hline
661Content & x & red$\_$3 & red$\_$2 & gn$\_$1 & ye$\_$1 & red$\_$1 & gn$\_$0 & ye$\_$0 & red$\_$0 \\\hline
662\end{tabular}
663\end{small}
664\caption{'on-board status LEDs' register}
665\label{tab:FTM-LED-register}
666\end{table}
667
668The period (time distance, see table \ref{tab:FTM-frequency-register}), with
669which light pulser and pedestal triggers are sent, is stored in the register
670at address 0x002. It is given in [ms] and adjustable between 1\,ms and
6711023\,ms (10 bits used). The next register defines the sequence of LP1, LP2
672and pedestal events (see table \ref{tab:FTM-ratio-register}).
673
674\begin{table}[h]
675\centering
676\begin{small}
677\begin{tabular}{|l|l|l|l|l|l|l|l|}\hline
678Bit & 15 - 10 & 9 & 8 & ... & 2 & 1 & 0 \\\hline
679Content & x & PERIOD\_9 & PERIOD\_8 & ... & PERIOD\_2 & PERIOD\_1 & PERIOD\_0 \\\hline
680\end{tabular}
681\end{small}
682\caption{Register for the period [ms] of calibration and pedestal events}
683\label{tab:FTM-frequency-register}
684\end{table}
685
686\begin{table}[h]
687\centering
688\begin{small}
689\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}\hline
690Bit & 15 & 14 & ... & 10 & 9 & ... & 5 & 4 & ... & 0 \\\hline
691Content & x & ped\_S4 & ... & ped\_S0 & LP2\_S4 & ... & LP2\_S0 & LP1\_S4 & ... & LP1\_S0 \\\hline
692\end{tabular}
693\end{small}
694\caption{Register defining the sequence of LP1, LP2 and pedestal events; 5
695 bits used per value. By setting e.g. LP1/LP2/PED = 3/2/1, the systems
696 generates 3 LP1 triggers, followed by 2 LP2 triggers, followed by 1 PED
697 trigger (if they are also activated in the 'general settings' register).
698 The distance between the triggers is defined with another register
699 (table~\ref{tab:FTM-frequency-register}).}
700\label{tab:FTM-ratio-register}
701\end{table}
702
703%\begin{table}[!h]
704%\centering
705%\begin{tiny}
706%\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}\hline
707%Bit & 15 - 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\\hline
708%Function & x & LPR2\_9 & LPR2\_8 & LPR2\_7 & LPR2\_6 & LPR2\_5 & LPR2\_4 & LPR2\_3 & LPR2\_2 & LPR2\_1 & LPR2\_0 \\\hline
709%\end{tabular}
710%\end{tiny}
711%\caption{Light pulser 2 frequency register at address 0x00E: This register contains the pulse rate of the light
712% pulser 2 in Hz.}
713%\label{tab:Light-pulser-2-frequancy-register}
714%\end{table}
715
716In order to define the amplitude and characteristics of the light pulses that
717are generated by the LP1 and the LP2 system, the registers 'LP1 amplitude' and
718'LP2 amplitude' are used, respectively. These registers are presented in
719table~\ref{tab:LP1-amplitude-register} and table~\ref{tab:LP2-amplitude-register}.
720The two most significant bits allow to switch on additional LEDs, while the six
721least significant bits are used for the FM (frequency modulation) on the
722light pulser board. These six bits (FM1\_5 ... FM1\_0 and FM2\_5 ... FM2\_0,
723respectively) are frequency dividing factors and the resulting frequency for the
724feedback is $ f_{FM} = \frac{5MHz}{25 + \mid FM1\_5 ... FM1\_0 \mid} $.
725
726This FM signal is used for stabilizing the amplitude
727of the light pulses, see the schematics \cite{FLD-Schematics}.
728
729The light pulser systems are controlled from the FTM by means of four LVDS control lines:
730The first line goes directly to the LED driver circuit and triggers a lightpulse.
731The FM signal is on the second line.
732The third and forth line allow to switch on additional LEDs.
733
734\begin{table}[!h]
735\centering
736\begin{small}
737\begin{tabular}{|l|l|l|l|l|}\hline
738Bit & 15 & 14 & 13 ... 6 & 5 ... 0 \\\hline
739Content & add\_LEDs1\_1& add\_LEDs1\_0 & x & FM1\_5 ... FM1\_0 \\\hline
740\end{tabular}
741\end{small}
742\caption{Light pulser 1 amplitude register}
743\label{tab:LP1-amplitude-register}
744\end{table}
745
746
747\begin{table}[!h]
748\centering
749\begin{small}
750\begin{tabular}{|l|l|l|l|l|}\hline
751Bit & 15 & 14 & 13 ... 6 & 5 ... 0 \\\hline
752Content & add\_LEDs2\_1& add\_LEDs2\_0 & x & FM2\_5 ... FM2\_0 \\\hline
753\end{tabular}
754\end{small}
755\caption{Light pulser 2 amplitude register}
756\label{tab:LP2-amplitude-register}
757\end{table}
758
759The different settings of the 'n-out-of-40' logic (physics or calibration
760events) are stored in two separate registers, which both have a structure
761according to table~\ref{tab:FTM-majority}.
762
763\begin{table}[!h]
764\centering
765\begin{small}
766\begin{tabular}{|l|l|l|l|l|l|l|l|}\hline
767Bit & 15...6 & 5 & 4 & 3 & 2 &1 & 0 \\\hline
768Content & x & n5 & n4 & n3 & n2 & n1 & n0 \\\hline
769\end{tabular}
770\end{small}
771\caption{Structure of the two majority coincidence (n-out-of-40) registers; the binary value
772 in these registers is the minimum number n of FTU trigger primitives required to trigger an event (physics or calibration)}
773\label{tab:FTM-majority}
774\end{table}
775
776In addition, there are several registers in the static data block to define
777delays (e.g. for the trigger). Also a general dead time to be applied after
778each trigger can be set (to compensate for the delay of the busy line). The
779clock conditioner settings are specified at address 0x00D to 0x01C (LMK03000
780from National Semiconductor, for more details see \cite{LMK03000}).
781
782Starting at address 0x020, the FTU settings are stored. The FTM always holds
783the complete FTU parameters in the static data block. For the meaning of these
784registers, please refer to the FTU firmware specifications document
785\cite{FTUspecs}. The register at address 0x029 is special in the sense that,
786in addition to its normal meaning, it also defines the time period with which
787the FTU rates are sent automatically to the FTMcontrol software. In case not
788all FTUs are connected during e.g. the testing phase, or a FTU is broken, the
789'active FTU list' registers can be used to disable certain boards. Bits 9...0
790of one of the active FTU lists (address 0x1B0 to 0x1B3, corresponding to crate
7910 to 3) contain the "active" flag for every FTU board. Setting a bit activates
792the corresponding FTU board while a "0" deactivates it.
793
794\section{Dynamic data block}
795\label{sec:Dynamic-data-block}
796The dynamic data block shown in table \ref{tab:FTM-dynamic-data-block}
797contains permanently updated data stored inside the FTM FPGA. It contains the
798actual on-time counter reading, the board temperatures (not yet supported) and the trigger rates
799measured by the FTUs. The on-board 12-bit temperature
800sensors are MAX6662 chips from Maxim Products. For more information about
801these components and their data see \cite{MAX6662}.
802This data block is updated and sent periodically by the
803FTM. Thus the FTMcontrol software receives periodically a corresponding data
804package via ethernet. The counting interval of the FTU board 0 on crate 0
805('prescaling' register) defines the period. When sending the dynamic
806data block, the header defined in table~\ref{tab:FTM-header} is added at the
807beginning.
808
809\newpage
810
811% \begin{table}[h]
812% \centering
813\begin{longtable}[!h]{|l|l|}\hline
814word no & content\\\hline\hline
8150x000 & on-time counter at read-out time bits 63...48, filled up with zeros \\\hline
8160x001 & on-time counter at read-out time bits 47...32 \\\hline
8170x002 & on-time counter at read-out time bits 31...16 \\\hline
8180x003 & on-time counter at read-out time bits 15...0 \\\hline
819% 0x004 & temperature sensor 0: component U45 on the FTM schematics \cite{FTM-Schematics}\\\hline
820% 0x005 & temperature sensor 1: U46 \\\hline
821% 0x006 & temperature sensor 2: U48 \\\hline
822% 0x007 & temperature sensor 3: U49 \\\hline
8230x004 & temperature sensor 0: not used so far\\\hline
8240x005 & temperature sensor 1: not used so far\\\hline
8250x006 & temperature sensor 2: not used so far\\\hline
8260x007 & temperature sensor 3: not used so far\\\hline
8270x008 & rate counter bit 29...16 patch 0 board 0 crate 0 \\\hline
8280x009 & rate counter bit 15...0 patch 0 board 0 crate 0 \\\hline
8290x00A & rate counter bit 29...16 patch 1 board 0 crate 0 \\\hline
8300x00B & rate counter bit 15...0 patch 1 board 0 crate 0 \\\hline
8310x00C & rate counter bit 29...16 patch 2 board 0 crate 0 \\\hline
8320x00D & rate counter bit 15...0 patch 2 board 0 crate 0 \\\hline
8330x00E & rate counter bit 29...16 patch 3 board 0 crate 0 \\\hline
8340x00F & rate counter bit 15...0 patch 3 board 0 crate 0 \\\hline
8350x010 & rate counter bit 29...16 total board 0 crate 0 \\\hline
8360x011 & rate counter bit 15...0 total board 0 crate 0\\\hline
8370x012 & Overflow register board 0 crate 0 \\\hline
8380x013 & CRC-error register board 0 crate 0 \\\hline
8390x014 & rate counter bit 29...16 patch 0 board 1 crate 0 \\\hline
8400x015 & rate counter bit 15...0 patch 0 board 1 crate 0 \\\hline
8410x016 & rate counter bit 29...16 patch 1 board 1 crate 0 \\\hline
8420x017 & rate counter bit 15...0 patch 1 board 1 crate 0 \\\hline
8430x018 & rate counter bit 29...16 patch 2 board 1 crate 0 \\\hline
8440x019 & rate counter bit 15...0 patch 2 board 1 crate 0 \\\hline
8450x01A & rate counter bit 29...16 patch 3 board 1 crate 0 \\\hline
8460x01B & rate counter bit 15...0 patch 3 board 1 crate 0 \\\hline
8470x01C & rate counter bit 29...16 total board 1 crate 0 \\\hline
8480x01D & rate counter bit 15...0 total board 1 crate 0 \\\hline
8490x01E & Overflow register board 1 crate 0 \\\hline
8500x01F & CRC-error register board 1 crate 0 \\\hline
851... & ... \\\hline
8520x1E7 & CRC-error register board 9 crate 3 \\\hline
853% \end{longtable}
854\caption{FTM dynamic data block}
855\label{tab:FTM-dynamic-data-block}
856\end{longtable}
857
858%\section{Trigger-list}
859%\label{sec:trigger-list}
860%The FTM board records all triggers in a list, the so-called trigger-list.
861%This trigger-list comprises a maximum of 50 triggers. The first eleven words
862%are the same as in the static- and dynamic data block. During data-taking-,
863%calibration- and trigger runs, the Trigger-list is automatically sent to the
864%main control each time the 50 triggers are reached or the run is finished. In
865%addition, the Trigger-list can also be read-out by the main control with the
866%according command. In case the run finishes or is terminated, as well as when
867%read out manually, the trigger list might be shorter than 50 events.
868
869%% \begin{table}[h]
870%% \centering
871%\begin{longtable}[h]{|l|l|}\hline
872%address & content\\\hline\hline
873%0x000 & board ID bit 63 - 48 \\\hline
874%0x001 & board ID bit 47 - 32\\\hline
875%0x002 & board ID bit 31 - 16\\\hline
876%0x003 & board ID bit 15 - 0\\\hline
877%0x004 & firmware ID \\\hline
878%0x005 & Trigger counter at read-out time bits 31 .. 16 \\\hline
879%0x006 & Trigger counter at read-out time bits 15 .. 0\\\hline
880%0x007 & Time stamp counter at read-out time bits 47 .. 32 \\\hline
881%0x008 & Time stamp counter at read-out time bits 31 .. 16 \\\hline
882%0x009 & Time stamp counter at read-out time bits 15 .. 0 \\\hline
883%0x00A & spare \\\hline
884
885%0x00B & on-time counter at read-out time bits 47 .. 32 \\\hline
886%0x00C & on-time counter at read-out time bits 31 .. 16 \\\hline
887%0x00D & on-time counter at read-out time bits 15 .. 0 \\\hline
888
889%0x00E & 1st event Trigger-ID \\\hline
890%0x00F & 1st event Trigger-ID \\\hline
891%0x010 & 1st event Trigger-ID \\\hline
892%0x011 & 1st event Trigger primitives crate 0 \\\hline
893%0x012 & 1st event Trigger primitives crate 1 \\\hline
894%0x013 & 1st event Trigger primitives crate 2 \\\hline
895%0x014 & 1st event Trigger primitives crate 3 \\\hline
896%0x015 & 1st event Time stamp counter at trigger time bits 47 .. 32 \\\hline
897%0x016 & 1st event Time stamp counter at trigger time bits 31 .. 16 \\\hline
898%0x017 & 1st event Time stamp counter at trigger time bits 15 .. 0 \\\hline
899
900%0x018 & 2nd event Trigger-ID \\\hline
901%0x019 & 2nd event Trigger-ID \\\hline
902%0x01A & 2nd event Trigger-ID \\\hline
903%0x01B & 2nd event Trigger primitives crate 0 \\\hline
904%0x01C & 2nd event Trigger primitives crate 1 \\\hline
905%0x01D & 2nd event Trigger primitives crate 2 \\\hline
906%0x01E & 2nd event Trigger primitives crate 3 \\\hline
907%0x01F & 2nd event Time stamp counter at trigger time bits 47 .. 32 \\\hline
908%0x020 & 2nd event Time stamp counter at trigger time bits 31 .. 16 \\\hline
909%0x021 & 2nd event Time stamp counter at trigger bits 15 .. 0 \\\hline
910%... & ...\\\hline
911%0x1F8 & 50th event Trigger-ID \\\hline
912%0x1F9 & 50th event Trigger-ID \\\hline
913%0x1FA & 50th event Trigger-ID \\\hline
914%0x1FB & 50th event Trigger primitives crate 0 \\\hline
915%0x1FC & 50th event Trigger primitives crate 1 \\\hline
916%0x1FD & 50th event Trigger primitives crate 2 \\\hline
917%0x1FE & 50th event Trigger primitives crate 3 \\\hline
918%0x1FF & 50th event Time stamp counter at trigger time bits 47 .. 32 \\\hline
919%0x200 & 50th event Time stamp counter at trigger time bits 31 .. 16 \\\hline
920%0x201 & 50th event Time stamp counter at trigger bits 15 .. 0 \\\hline
921
922%% \end{longtable}
923%\caption{FTM trigger list}
924%\label{tab:FTM-trigger-list}
925%\end{longtable}
926
927\section{FTU list}
928\label{sec:FTU-List}
929When the FTM board receives the 'ping all FTUs' instruction, it sends a ping
930command to all FTU boards and gathers the FTU boards responses to a list. This
931list is called 'FTU list' and shown in table \ref{tab:FTU-list}. When the FTU
932list is complete, it is sent back via ethernet with the header defined in
933table~\ref{tab:FTM-header}.
934
935\begin{longtable}[!h]{|l|l|}\hline
936address & content\\\hline\hline
9370x000 & total number of responding FTU boards\\\hline
9380x001 & number of responding FTU boards belonging to crate 0 \\\hline
9390x002 & number of responding FTU boards belonging to crate 1 \\\hline
9400x003 & number of responding FTU boards belonging to crate 2 \\\hline
9410x004 & number of responding FTU boards belonging to crate 3 \\\hline
9420x005 & active FTU list crate 0 \\\hline
9430x006 & active FTU list crate 1 \\\hline
9440x007 & active FTU list crate 2 \\\hline
9450x008 & active FTU list crate 3 \\\hline
9460x009 & address of first FTU board and number of sent pings until response\\\hline
9470x00A & DNA of first FTU board bit 63 ... 48\\\hline
9480x00B & DNA of first FTU board bit 47 ... 32\\\hline
9490x00C & DNA of first FTU board bit 31 ... 16\\\hline
9500x00D & DNA of first FTU board bit 15 ... 0\\\hline
9510x00E & CRC error counter reading of first FTU board\\\hline
9520x00F & address of second FTU board and number of sent pings until response\\\hline
9530x010 & DNA of second FTU board bit 63 ... 48\\\hline
9540x011 & DNA of second FTU board bit 47 ... 32\\\hline
9550x012 & DNA of second FTU board bit 31 ... 16\\\hline
9560x013 & DNA of second FTU board bit 15 ... 0\\\hline
9570x014 & CRC error counter reading of second FTU board\\\hline
958... & ...\\\hline
9590x0F8 & CRC error counter reading of last FTU board\\\hline
960\caption{FTU list}
961\label{tab:FTU-list}
962\end{longtable}
963
964In case there is no response to a 'ping' for a certain FTU address, there are
965up to two repetitions. If there is still no answer, only zeros are written
966into the FTU list for this particular board. A responding FTU board gets a
967regular entry, including the number of 'ping' sent until response. The number
968of pings is coded together with the FTU board address as shown in table
969\ref{tab:FTU-crate-number-and-address}. The two bits 'pings\_0' and 'pings\_1'
970contain the number of 'pings' until response of an FTU board (coded in
971binary). The 'DNA' of the FTU board is the device DNA \cite{ds557, ds610,
972 wp267, wp266} of the FPGA on the responding FTU board. This is a unique 57
973bit serial number unambiguously identifying every Xilinx FPGA. In the most
974significant word (bit 63 ... 48) bits 63 down to 57 are filled with zeros.
975
976\begin{table}[!h]
977\centering
978\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|}\hline
979Bit & 15 ... 10 & 9 & 8 & 7 & 6 & 5 & ... & 0 \\\hline
980Content & x ... x & pings\_1 & pings\_0 & x & x & A5 & ... & A0 \\\hline
981\end{tabular}
982\caption{Address of FTU board and number of pings until response. In case
983 there is no response at all, this number is set to 0.}
984\label{tab:FTU-crate-number-and-address}
985\end{table}
986
987\chapter{FTU communication error handling}
988\label{cha:Error-handling}
989
990When the FTM board is communicating with a FTU board via RS-485, the FTU board
991has to respond within 2\,ms (after the last byte was transmitted). If this
992timeout expires, or the response sent back by the FTU board is incorrect, the
993FTM resends the datapacket after the timeout. If this second attempt is still
994unsuccessful, a third and last attempt will be made by the FTM board. An error
995message will be sent to the FTMcontrol whenever a FTU board does not send a
996correct answer after the first call by the FTM board. This message (see
997table~\ref{tab:error-message}) contains, after the standard header (see
998table~\ref{tab:FTM-header}), the number of calls until response (0 if no
999response at all), and the corresponding data packet which was sent to the FTU
1000board. In order to avoid massive error messages for e.g. test setups with
1001single FTUs, the 'active FTU list' can be employed to disable FTUs from the
1002bus. In that case the FTM will not try to contact the corresponding boards.
1003
1004\begin{table}[!h]
1005 \centering
1006 \begin{tabular}{|l|l|}\hline
1007 word no & content\\\hline\hline
1008 0x000 & number of calls until response (0 if no response at all)\\\hline
1009 0x001 ... 0x01C & slow control data packet sent to FTU (28 words/bytes)\\\hline
1010 \end{tabular}
1011 \caption{FTU communication error message (after standard header); for a
1012 description of the FTU data package, see \cite{FTUspecs}.}
1013 \label{tab:error-message}
1014\end{table}
1015
1016%---------------------------------------------------------------------------------
1017
1018\bibliographystyle{unsrt}
1019%\bibliography{FTM-Com}
1020
1021\begin{thebibliography}{1}
1022
1023\bibitem{DRS4}
1024Paul Scherrer Institut PSI.
1025\newblock {\em DRS4 9 Channel, 5 GSPS Switched Capacitor Array}.
1026\newblock http://drs.web.psi.ch
1027\newblock datasheet.
1028
1029\bibitem{LMK03000}
1030National Semiconductor Corporation.
1031\newblock {\em LMK03000 Family Precision Clock Conditioner with integrated
1032 VCO}, 2008.
1033\newblock datasheet.
1034
1035\bibitem{FTM-Schematics}
1036ETH Z{\"u}rich, IPP.
1037\newblock {\em FTM Schematics}, 2010.
1038
1039\bibitem{W5300}
1040WIZnet Co.Ltd.
1041\newblock {\em W5300 Fully Hardwired Network protocol Embedded Ethernet
1042 Controller}, 2008.
1043\newblock datasheet.
1044
1045\bibitem{ds557}
1046Xilinx.
1047\newblock {\em Spartan-3AN FPGA Family Data Sheet}, 2009.
1048
1049\bibitem{ds610}
1050Xilinx.
1051\newblock {\em Spartan-3A DSP FPGA Family: Data Sheet}, 2009.
1052
1053\bibitem{wp267}
1054Xilinx.
1055\newblock {\em Advanced Security Schemes for Spartan-3A/3AN/3A DSP FPGAs},
1056 2007.
1057
1058\bibitem{wp266}
1059Xilinx.
1060\newblock {\em Security Solutions Using Spartan-3 Generation FPGAs}, 2008.
1061
1062\bibitem{MAX6662}
1063Maxim Integrated Products.
1064\newblock {\em 12-Bit plus Sign Temperature Sensor with SPI-Compatible Serial
1065 Interface MAX6662}, 2001.
1066\newblock datasheet.
1067
1068\bibitem{FTUspecs}
1069ETH Z{\"u}rich, IPP.
1070\newblock {\em FTU Firmware Specifications v3}, 2010.
1071
1072
1073\bibitem{FLD-Schematics}
1074ETH Z{\"u}rich, IPP.
1075\newblock {\em FLD Schematics, FACT light driver}, 2010.
1076
1077
1078\end{thebibliography}
1079
1080\end{document}
Note: See TracBrowser for help on using the repository browser.