| 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 |  | 
|---|
| 42 | The FTM (FACT Trigger Master) board collects the trigger primitives from all | 
|---|
| 43 | 40 FTU boards (FACT Trigger Unit) and generates the trigger signal for the | 
|---|
| 44 | FACT camera. The trigger logic is a 'n-out-of-40' majority coincidence of all | 
|---|
| 45 | trigger primitives. Beside the trigger, the FTM board also generates a | 
|---|
| 46 | trigger-ID (see chapter \ref{cha:Trigger-ID}). It is controlled from outside | 
|---|
| 47 | via ethernet. Two auxiliary RS-485 interfaces are also available in hardware, | 
|---|
| 48 | but not yet supported in firmware. | 
|---|
| 49 |  | 
|---|
| 50 | In addition to the trigger, the FTM board also generates other fast control | 
|---|
| 51 | signals: Time-Marker (TIM), DRS \cite{DRS4} reference clock (CLD) and | 
|---|
| 52 | reset. These four fast control signals are distributed to the FAD (FACT Analog | 
|---|
| 53 | to Digital) boards via two FFC (FACT Fast Control) boards. The FTM board also | 
|---|
| 54 | provides, via the TIM line, the signal for the DRS timing calibration. In order | 
|---|
| 55 | to generate the CLD DRS reference clock, as well as the time-marker signal for | 
|---|
| 56 | DRS timing calibration, the FTM board uses a clock conditioner | 
|---|
| 57 | \cite{LMK03000}. | 
|---|
| 58 |  | 
|---|
| 59 | The FTM board has two time counters, the 'timestamp counter' and the 'on-time | 
|---|
| 60 | counter'. While the 'timestamp counter' runs continuously, the 'on-time | 
|---|
| 61 | counter' only counts when the camera trigger is enabled, i.e. when no FAD board | 
|---|
| 62 | is busy and not during the dead time. Both counters are reset at the beginning and | 
|---|
| 63 | at the end of a run. | 
|---|
| 64 |  | 
|---|
| 65 | The FTM board further serves as slow control master for the 40 FTU boards. The | 
|---|
| 66 | slow control of the FTU boards and the distribution of the trigger-ID to the | 
|---|
| 67 | FAD boards are performed via dedicated RS-485 buses. Because the FAD as well | 
|---|
| 68 | as the FTU boards are arranged in crates of 10 boards each, the FTM board has | 
|---|
| 69 | four connectors, one for each crate. Running over these connectors there are | 
|---|
| 70 | two RS-485 buses (one for FTU slow control and one for the trigger-ID) besides | 
|---|
| 71 | the busy signal from the FAD boards and the crate reset. | 
|---|
| 72 |  | 
|---|
| 73 | In addition, the FTM board controls the two FLPs (FACT Light Pulser) via four | 
|---|
| 74 | LVDS signals each. Light pulser~1 (also known as `external lightpulser`) is | 
|---|
| 75 | located in the mirror dish, light pulser~2 (also known as `internal lightpulser`) | 
|---|
| 76 | inside the camera shutter. There are also digital auxiliary in- and | 
|---|
| 77 | outputs according to the NIM (Nuclear Instrumentation Module) standard, for | 
|---|
| 78 | example for external triggers and veto, and to have the signals accessible. | 
|---|
| 79 |  | 
|---|
| 80 | The main component of the FTM board is a FPGA (Xilinx Spartan | 
|---|
| 81 | XC3SD3400A-4FGG676C), fulfilling the main functions within the board. The | 
|---|
| 82 | purpose of this document is to provide specifications needed for the | 
|---|
| 83 | understanding of the firmware of this FPGA and the software (called 'FTMcontrol' | 
|---|
| 84 | in the following) controlling the FTM board. For further information about the | 
|---|
| 85 | FTM board hardware please refer to \cite{FTM-Schematics}. | 
|---|
| 86 |  | 
|---|
| 87 | \chapter{Trigger-ID} | 
|---|
| 88 | \label{cha:Trigger-ID} | 
|---|
| 89 |  | 
|---|
| 90 | For each processed trigger the FTM board generates a unique trigger-ID to be | 
|---|
| 91 | broadcasted to all FAD boards and added to the event data. This trigger-ID | 
|---|
| 92 | consists of a 32 bit trigger number, a two byte trigger type indicator and a | 
|---|
| 93 | checksum. The transmission protocol for the trigger-ID broadcast is shown in | 
|---|
| 94 | table \ref{tab:Trigger-ID broadcast}. | 
|---|
| 95 |  | 
|---|
| 96 | \begin{table}[htbp] | 
|---|
| 97 | \centering | 
|---|
| 98 | \begin{tabular}{|l|l|}\hline | 
|---|
| 99 | byte no & content\\\hline\hline | 
|---|
| 100 | 0 & Trigger-No first byte (least significant byte) \\\hline | 
|---|
| 101 | 1 & Trigger-No second byte\\\hline | 
|---|
| 102 | 2 & Trigger-No third byte\\\hline | 
|---|
| 103 | 3 & Trigger-No forth byte (most significant byte)\\\hline | 
|---|
| 104 | 4 & Trigger-Type 1\\\hline | 
|---|
| 105 | 5 & Trigger-Type 2\\\hline | 
|---|
| 106 | 6 & 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 |  | 
|---|
| 112 | A Cyclic Redundancy Check (CRC) over byte 0 - 5 is used to evaluate the | 
|---|
| 113 | integrity of the trigger-ID. An 8-CCITT CRC has been chosen which is based on | 
|---|
| 114 | the polynomial $x^8 + x^2 + x + 1$ (00000111, omitting the most significant | 
|---|
| 115 | bit). The resulting 1-byte checksum comprises the last byte of the trigger-ID. | 
|---|
| 116 | The transmission of the trigger-ID to the FAD boards is done by means of | 
|---|
| 117 | dedicated RS-485 buses (one per crate). | 
|---|
| 118 |  | 
|---|
| 119 | In the first byte of the trigger type indicator (see table | 
|---|
| 120 | \ref{tab:Trigger-Type 1}) n0 - n5 indicate the number of trigger primitives | 
|---|
| 121 | required for a trigger, thus the 'n' of the 'n-out-of-40' majority | 
|---|
| 122 | coincidence. The two flags 'external trigger 1' and 'external trigger 2', | 
|---|
| 123 | when set, indicate a trigger from the corresponding NIM inputs. See also | 
|---|
| 124 | section \ref{sec:Static-data-block} and table \ref{tab:FTM-majority} for | 
|---|
| 125 | further 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 | 
|---|
| 143 | Bit7 & Bit6 & Bit5 & Bit4 & Bit3 & Bit2 & Bit1 & Bit0\\\hline\hline | 
|---|
| 144 | TIM 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 |  | 
|---|
| 151 | The 'TIM source' bit in 'Trigger-Type 2' (see table \ref{tab:Trigger-Type 2}) | 
|---|
| 152 | indicates the source of the timemarker signal: a '0' indicates the timemarker | 
|---|
| 153 | being produced in the FPGA while a '1' indicates the timemarker coming from | 
|---|
| 154 | the clock conditioner. The flags 'LP\_1' and 'LP\_2' are set when the | 
|---|
| 155 | corresponding lightpulser has flashed while the 'pedestal' flag is set in case | 
|---|
| 156 | of a pedestal (random) trigger. An event having none of these flags set | 
|---|
| 157 | indicates 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. | 
|---|
| 161 | The bits 'LP\_set\_0' to 'LP\_set\_3' can be used in the future to | 
|---|
| 162 | code information about the light pulser settings. They only have a meaning in | 
|---|
| 163 | case 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 |  | 
|---|
| 169 | The communication between the FTM board and the FTMcontrol software, including | 
|---|
| 170 | the corresponding commands, protocols and data, is based on 16-bit words and | 
|---|
| 171 | big-endian. This is to facilitate the data-transmission over the Wiznet W5300 | 
|---|
| 172 | ethernet interface \cite{W5300}. | 
|---|
| 173 |  | 
|---|
| 174 | The 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 | 
|---|
| 176 | identifies the command. Next there is a parameter further refining the | 
|---|
| 177 | command, e.g. what to read. The fourth and fifth words are spares and should | 
|---|
| 178 | contain zeros only. Starting from the sixth word, an optional data block of | 
|---|
| 179 | variable size is following. This data block differs in length and content | 
|---|
| 180 | depending on command and parameter. In case of 'read' instructions, the | 
|---|
| 181 | corresponding 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 |  | 
|---|
| 208 | So 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' | 
|---|
| 211 | commands are shown in table~\ref{tab:FTM-read-command-param} and | 
|---|
| 212 | table~\ref{tab:FTM-write-command-param}, respectively. With the 'autosend | 
|---|
| 213 | on/off' command it is possible to switch off the automatic sending of trigger | 
|---|
| 214 | rates and error messages (see table~\ref{tab:FTM-as-command-param}). | 
|---|
| 215 |  | 
|---|
| 216 | The 'config single FTU' command has as its parameters a crate and a board number | 
|---|
| 217 | as it is shown in table~\ref{tab:FTM-cfsingleFTU-command-param}. | 
|---|
| 218 | Before the 'config single FTU' command can be meaningfully executed, the corresponding | 
|---|
| 219 | data has to be written into the static data block (see section~\ref{sec:Static-data-block}), | 
|---|
| 220 | using e.g. 'write single address' commands. | 
|---|
| 221 | The 'config single FTU' command then writes the new configuration to the corresponding FTU board, | 
|---|
| 222 | even 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 |  | 
|---|
| 307 | In table \ref{tab:FTM-start-command-param} the parameters to start a run are | 
|---|
| 308 | listed. 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 | 
|---|
| 310 | to be sent by the FTMcontrol before starting a run. Therefore the only | 
|---|
| 311 | option is to start an "endless" run or to take X events (Not yet implemented in firmware) instead. | 
|---|
| 312 | In the latter | 
|---|
| 313 | case X is defined by a two words (32 bit) long unsigned integer, making up the | 
|---|
| 314 | command data block. The 'start run' command enables the transmission of | 
|---|
| 315 | trigger signals (physics, calibration or pedestal) to the FAD boards and | 
|---|
| 316 | resets the trigger and time counters. There is no parameter for stopping a | 
|---|
| 317 | run. If a number of events has been specified ('take X events'), the run will | 
|---|
| 318 | terminate if either the 'stop run' command is received or the requested number | 
|---|
| 319 | of events is reached. In any case the trigger and time counters are reset, | 
|---|
| 320 | too. | 
|---|
| 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 |  | 
|---|
| 351 | In case of a 'ping FTUs' command the FTM will address the FTUs one by one and | 
|---|
| 352 | readout 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 | 
|---|
| 354 | parameters for this command. With the 'crate reset' command the FTU and FAD boards of a | 
|---|
| 355 | particular crate are rebooted (only the FPGAs), where the command parameter defines the | 
|---|
| 356 | crate number (see table \ref{tab:FTM-reset-command-param}). Only one crate | 
|---|
| 357 | reset at a time is possible, i.e. the FTM firmware does not allow to reset | 
|---|
| 358 | multiple 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 |  | 
|---|
| 378 | The trigger master features two main data blocks, named 'static data block' | 
|---|
| 379 | and 'dynamic data block' in the following. They are implemented in the | 
|---|
| 380 | firmware as block-RAM. In addition, there is the so-called 'FTU list', which | 
|---|
| 381 | is filled only on request ('ping FTUs' command). If any of these blocks is | 
|---|
| 382 | sent to the FTMcontrol (either automatically or on demand), a header with a | 
|---|
| 383 | size of 14 words is added, and the whole data package is put between a start | 
|---|
| 384 | and an end delimiter (see table~\ref{tab:FTM-package}). The header is | 
|---|
| 385 | identical for all data blocks and contains solely read-only information: the | 
|---|
| 386 | type and length of the package, the FTM status, the FTM board ID (57-bit | 
|---|
| 387 | Xilinx device DNA \cite{ds557, ds610, wp267, wp266}), a firmware ID and the | 
|---|
| 388 | readings of the trigger counter and time stamp counter since last reset (see | 
|---|
| 389 | table~\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 |  | 
|---|
| 427 | In 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 |  | 
|---|
| 449 | The static data block contains all the settings needed to configure and | 
|---|
| 450 | operate the FTM. It has to be written by the FTMcontrol each time before a run | 
|---|
| 451 | is started or, in general, some component has to be reprogrammed. In | 
|---|
| 452 | addition, whenever the FTM board receives a new static data block, it performs | 
|---|
| 453 | a complete reconfiguration including a reprogramming of the FTUs. | 
|---|
| 454 | As an exception, the clock conditioner is only reprogrammed, if its settings | 
|---|
| 455 | really changed. When a new static data block is received during a run, it | 
|---|
| 456 | is written to the memeory, but subsequently ignored. | 
|---|
| 457 | Table~\ref{tab:FTM-trigger-master-static-data-block} summarizes the | 
|---|
| 458 | static data block. More details about the individual registers can be found in | 
|---|
| 459 | the 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 | 
|---|
| 477 | word no & content & description\\\hline\hline | 
|---|
| 478 | 0x000 & general settings & see table~\ref{tab:FTM-general-settings-register} and text\\\hline | 
|---|
| 479 | 0x001 & on-board status LEDs & see table~\ref{tab:FTM-LED-register}\\\hline | 
|---|
| 480 | 0x002 & light pulser and pedestal trigger period & see table~\ref{tab:FTM-frequency-register} and text\\\hline | 
|---|
| 481 | 0x003 & sequence of LP1, LP2 and PED triggers & see table~\ref{tab:FTM-ratio-register} and text\\\hline | 
|---|
| 482 |  | 
|---|
| 483 | 0x004 & light pulser 1 amplitude & see table~\ref{tab:LP1-amplitude-register} and text\\\hline | 
|---|
| 484 | 0x005 & light pulser 2 amplitude & see table~\ref{tab:LP2-amplitude-register} and text\\\hline | 
|---|
| 485 | 0x006 & light pulser 1 delay & 8ns + delay value*4ns\\\hline | 
|---|
| 486 | 0x007 & light pulser 2 delay & 8ns + delay value*4ns\\\hline | 
|---|
| 487 |  | 
|---|
| 488 | 0x008 & majority coincidence n (for physics) & see table~\ref{tab:FTM-majority} and text\\\hline | 
|---|
| 489 | 0x009 & majority coincidence n (for calibration) & see table~\ref{tab:FTM-majority} and text\\\hline | 
|---|
| 490 | 0x00A & trigger delay & 8ns + delay value*4ns, 10 bits used\\\hline | 
|---|
| 491 | 0x00B & timemarker delay & 8ns + delay value*4ns, 10 bits used\\\hline | 
|---|
| 492 | 0x00C & dead time & 8ns + value*4ns, 16 bits used\\\hline | 
|---|
| 493 | 0x00D & clock conditioner R0 bits 31...16 & \\\hline | 
|---|
| 494 | 0x00E & clock conditioner R0 bits 15...0 & \\\hline | 
|---|
| 495 | 0x00F & clock conditioner R1 bits 31...16 & \\\hline | 
|---|
| 496 | 0x010 & clock conditioner R1 bits 15...0 & \\\hline | 
|---|
| 497 | 0x011 & clock conditioner R8 bits 31...16 & \\\hline | 
|---|
| 498 | 0x012 & clock conditioner R8 bits 15...0 & \\\hline | 
|---|
| 499 | 0x013 & clock conditioner R9 bits 31...16 & \\\hline | 
|---|
| 500 | 0x014 & clock conditioner R9 bits 15...0 & \\\hline | 
|---|
| 501 | 0x015 & clock conditioner R11 bits 31...16 & \\\hline | 
|---|
| 502 | 0x016 & clock conditioner R11 bits 15...0 & \\\hline | 
|---|
| 503 | 0x017 & clock conditioner R13 bits 31...16 & \\\hline | 
|---|
| 504 | 0x018 & clock conditioner R13 bits 15...0 & \\\hline | 
|---|
| 505 | 0x019 & clock conditioner R14 bits 31...16 & \\\hline | 
|---|
| 506 | 0x01A & clock conditioner R14 bits 15...0 & \\\hline | 
|---|
| 507 | 0x01B & clock conditioner R15 bits 31...16 & \\\hline | 
|---|
| 508 | 0x01C & clock conditioner R15 bits 15...0 & \\\hline | 
|---|
| 509 | 0x01D & maj. coinc. window (for physics) & 8ns + value*4ns, 4 bits used\\\hline | 
|---|
| 510 | 0x01E & maj. coinc. window (for calibration) & 8ns + value*4ns, 4 bits used \\\hline | 
|---|
| 511 | 0x01F & spare & \\\hline | 
|---|
| 512 | 0x020 & enables patch 0 board 0 crate 0 & see FTU documentation\\\hline | 
|---|
| 513 | 0x021 & enables patch 1 board 0 crate 0 & see FTU documentation\\\hline | 
|---|
| 514 | 0x022 & enables patch 2 board 0 crate 0 & see FTU documentation\\\hline | 
|---|
| 515 | 0x023 & enables patch 3 board 0 crate 0 & see FTU documentation\\\hline | 
|---|
| 516 | 0x024 & DAC$\_$A board 0 crate 0 & see FTU documentation \\\hline | 
|---|
| 517 | 0x025 & DAC$\_$B board 0 crate 0 & see FTU documentation \\\hline | 
|---|
| 518 | 0x026 & DAC$\_$C board 0 crate 0 & see FTU documentation \\\hline | 
|---|
| 519 | 0x027 & DAC$\_$D board 0 crate 0 & see FTU documentation \\\hline | 
|---|
| 520 | 0x028 & DAC$\_$H board 0 crate 0 & see FTU documentation \\\hline | 
|---|
| 521 | 0x029 & Prescaling board 0 crate 0 & (value+1)/2~[s], also autosend period \\\hline | 
|---|
| 522 | 0x02A & enables patch 0 board 1 crate 0 & see FTU documentation  \\\hline | 
|---|
| 523 | 0x02B & enables patch 1 board 1 crate 0 & see FTU documentation  \\\hline | 
|---|
| 524 | 0x02C & enables patch 2 board 1 crate 0 & see FTU documentation  \\\hline | 
|---|
| 525 | 0x02D & enables patch 3 board 1 crate 0 & see FTU documentation  \\\hline | 
|---|
| 526 | 0x02E & DAC$\_$A board 1 crate 0 & see FTU documentation \\\hline | 
|---|
| 527 | 0x02F & DAC$\_$B board 1 crate 0 & see FTU documentation \\\hline | 
|---|
| 528 | 0x030 & DAC$\_$C board 1 crate 0 & see FTU documentation \\\hline | 
|---|
| 529 | 0x031 & DAC$\_$D board 1 crate 0 & see FTU documentation \\\hline | 
|---|
| 530 | 0x032 & DAC$\_$H board 1 crate 0 & see FTU documentation \\\hline | 
|---|
| 531 | 0x033 & Prescaling board 1 crate 0 & see FTU documentation \\\hline | 
|---|
| 532 | ... & ... & \\\hline | 
|---|
| 533 | 0x1A6 & enables patch 0 board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 534 | 0x1A7 & enables patch 1 board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 535 | 0x1A8 & enables patch 2 board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 536 | 0x1A9 & enables patch 3 board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 537 | 0x1AA & DAC$\_$A board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 538 | 0x1AB & DAC$\_$B board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 539 | 0x1AC & DAC$\_$C board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 540 | 0x1AD & DAC$\_$D board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 541 | 0x1AE & DAC$\_$H board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 542 | 0x1AF & Prescaling board 9 crate 3 & see FTU documentation \\\hline | 
|---|
| 543 | 0x1B0 & active FTU list crate 0 & see FTU documentation \\\hline | 
|---|
| 544 | 0x1B1 & active FTU list crate 1 & see FTU documentation \\\hline | 
|---|
| 545 | 0x1B2 & active FTU list crate 2 & see FTU documentation \\\hline | 
|---|
| 546 | 0x1B3 & 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 |  | 
|---|
| 551 | The FTM general settings register is detailed in table | 
|---|
| 552 | \ref{tab:FTM-general-settings-register}. The 'TIM\_CLK' bit defines whether | 
|---|
| 553 | the time marker is generated by the FPGA ('TIM\_CLK' = 0, default for physics | 
|---|
| 554 | data 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 | 
|---|
| 557 | veto and trigger signals, respectively. In order to select which trigger | 
|---|
| 558 | sources are active during a run, the bits 'LP1', 'LP2', 'ped' and 'trigger' | 
|---|
| 559 | are foreseen (0 disabled, 1 enabled). During a physics run, for example, | 
|---|
| 560 | 'LP1', 'ped' and 'trigger' should all be set to generate interleaved | 
|---|
| 561 | calibration and pedestal events as well as activate the 'n-out-of-40' trigger | 
|---|
| 562 | input. For a didicated pedestal run only 'ped' should be set, since in this | 
|---|
| 563 | case the FTM sends directly a trigger to the FADs. For calibration runs it | 
|---|
| 564 | depends on whether the external (LP1) or internal (LP2) light pulser is used: | 
|---|
| 565 | For the first case 'LP1' and 'trigger' have to be set, since here the full | 
|---|
| 566 | trigger chain is involved and the camera triggers based on G-APD signals. | 
|---|
| 567 | For the second case only 'LP2' is needed, because the shutter is closed and the | 
|---|
| 568 | FTM sends the trigger signal directly to the FADs (like for pedestal | 
|---|
| 569 | events). 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 | 
|---|
| 576 | Bit & 15...8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\\hline | 
|---|
| 577 | Content & 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 |  | 
|---|
| 652 | The 'on-board status LEDs' register shown in table \ref{tab:FTM-LED-register} | 
|---|
| 653 | allows to switch a total of eight LEDs on the FTM board for debugging purposes | 
|---|
| 654 | by 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 | 
|---|
| 660 | Bit      & 15...8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\\hline | 
|---|
| 661 | Content &  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 |  | 
|---|
| 668 | The period (time distance, see table \ref{tab:FTM-frequency-register}), with | 
|---|
| 669 | which light pulser and pedestal triggers are sent, is stored in the register | 
|---|
| 670 | at address 0x002. It is given in [ms] and adjustable between 1\,ms and | 
|---|
| 671 | 1023\,ms (10 bits used). The next register defines the sequence of LP1, LP2 | 
|---|
| 672 | and 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 | 
|---|
| 678 | Bit      & 15 - 10 & 9 & 8 & ... & 2 & 1 & 0 \\\hline | 
|---|
| 679 | Content &  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 | 
|---|
| 690 | Bit      & 15 & 14 & ... & 10 & 9 & ... & 5 & 4 & ... & 0 \\\hline | 
|---|
| 691 | Content & 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 |  | 
|---|
| 716 | In order to define the amplitude and characteristics of the light pulses that | 
|---|
| 717 | are generated by the LP1 and the LP2 system, the registers 'LP1 amplitude' and | 
|---|
| 718 | 'LP2 amplitude' are used, respectively. These registers are presented in | 
|---|
| 719 | table~\ref{tab:LP1-amplitude-register} and table~\ref{tab:LP2-amplitude-register}. | 
|---|
| 720 | The two most significant bits allow to switch on additional LEDs, while the six | 
|---|
| 721 | least significant bits are used for the FM (frequency modulation) on the | 
|---|
| 722 | light pulser board. These six bits (FM1\_5 ... FM1\_0 and FM2\_5 ... FM2\_0, | 
|---|
| 723 | respectively) are frequency dividing factors and the resulting frequency for the | 
|---|
| 724 | feedback is $ f_{FM} = \frac{5MHz}{25 +  \mid FM1\_5 ... FM1\_0 \mid} $. | 
|---|
| 725 |  | 
|---|
| 726 | This FM signal is used for stabilizing the amplitude | 
|---|
| 727 | of the light pulses, see the schematics \cite{FLD-Schematics}. | 
|---|
| 728 |  | 
|---|
| 729 | The light pulser systems are controlled from the FTM by means of four LVDS control lines: | 
|---|
| 730 | The first line goes directly to the LED driver circuit and triggers a lightpulse. | 
|---|
| 731 | The FM signal is on the second line. | 
|---|
| 732 | The 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 | 
|---|
| 738 | Bit      & 15 & 14 & 13 ... 6 & 5 ... 0 \\\hline | 
|---|
| 739 | Content &  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 | 
|---|
| 751 | Bit      & 15 & 14 & 13 ... 6 & 5 ... 0 \\\hline | 
|---|
| 752 | Content &  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 |  | 
|---|
| 759 | The different settings of the 'n-out-of-40' logic (physics or calibration | 
|---|
| 760 | events) are stored in two separate registers, which both have a structure | 
|---|
| 761 | according 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 | 
|---|
| 767 | Bit      & 15...6 & 5 & 4 & 3 & 2 &1 & 0 \\\hline | 
|---|
| 768 | Content & 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 |  | 
|---|
| 776 | In addition, there are several registers in the static data block to define | 
|---|
| 777 | delays (e.g. for the trigger). Also a general dead time to be applied after | 
|---|
| 778 | each trigger can be set (to compensate for the delay of the busy line). The | 
|---|
| 779 | clock conditioner settings are specified at address 0x00D to 0x01C (LMK03000 | 
|---|
| 780 | from National Semiconductor, for more details see \cite{LMK03000}). | 
|---|
| 781 |  | 
|---|
| 782 | Starting at address 0x020, the FTU settings are stored. The FTM always holds | 
|---|
| 783 | the complete FTU parameters in the static data block. For the meaning of these | 
|---|
| 784 | registers, please refer to the FTU firmware specifications document | 
|---|
| 785 | \cite{FTUspecs}. The register at address 0x029 is special in the sense that, | 
|---|
| 786 | in addition to its normal meaning, it also defines the time period with which | 
|---|
| 787 | the FTU rates are sent automatically to the FTMcontrol software. In case not | 
|---|
| 788 | all 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 | 
|---|
| 790 | of one of the active FTU lists (address 0x1B0 to 0x1B3, corresponding to crate | 
|---|
| 791 | 0 to 3) contain the "active" flag for every FTU board. Setting a bit activates | 
|---|
| 792 | the corresponding FTU board while a "0" deactivates it. | 
|---|
| 793 |  | 
|---|
| 794 | \section{Dynamic data block} | 
|---|
| 795 | \label{sec:Dynamic-data-block} | 
|---|
| 796 | The dynamic data block shown in table \ref{tab:FTM-dynamic-data-block} | 
|---|
| 797 | contains permanently updated data stored inside the FTM FPGA. It contains the | 
|---|
| 798 | actual on-time counter reading, the board temperatures (not yet supported) and the trigger rates | 
|---|
| 799 | measured by the FTUs. The on-board 12-bit temperature | 
|---|
| 800 | sensors are MAX6662 chips from Maxim Products. For more information about | 
|---|
| 801 | these components and their data see \cite{MAX6662}. | 
|---|
| 802 | This data block is updated and sent periodically by the | 
|---|
| 803 | FTM. Thus the FTMcontrol software receives periodically a corresponding data | 
|---|
| 804 | package via ethernet. The counting interval of the FTU board 0 on crate 0 | 
|---|
| 805 | ('prescaling' register) defines the period. When sending the dynamic | 
|---|
| 806 | data block, the header defined in table~\ref{tab:FTM-header} is added at the | 
|---|
| 807 | beginning. | 
|---|
| 808 |  | 
|---|
| 809 | \newpage | 
|---|
| 810 |  | 
|---|
| 811 | % \begin{table}[h] | 
|---|
| 812 | %  \centering | 
|---|
| 813 | \begin{longtable}[!h]{|l|l|}\hline | 
|---|
| 814 | word no & content\\\hline\hline | 
|---|
| 815 | 0x000 & on-time counter at read-out time bits 63...48, filled up with zeros \\\hline | 
|---|
| 816 | 0x001 & on-time counter at read-out time bits 47...32 \\\hline | 
|---|
| 817 | 0x002 & on-time counter at read-out time bits 31...16 \\\hline | 
|---|
| 818 | 0x003 & 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 | 
|---|
| 823 | 0x004 & temperature sensor 0: not used so far\\\hline | 
|---|
| 824 | 0x005 & temperature sensor 1: not used so far\\\hline | 
|---|
| 825 | 0x006 & temperature sensor 2: not used so far\\\hline | 
|---|
| 826 | 0x007 & temperature sensor 3: not used so far\\\hline | 
|---|
| 827 | 0x008 & rate counter bit 29...16 patch 0 board 0 crate 0 \\\hline | 
|---|
| 828 | 0x009 & rate counter bit 15...0 patch 0 board 0 crate 0 \\\hline | 
|---|
| 829 | 0x00A & rate counter bit 29...16 patch 1 board 0 crate 0 \\\hline | 
|---|
| 830 | 0x00B & rate counter bit 15...0 patch 1 board 0 crate 0 \\\hline | 
|---|
| 831 | 0x00C & rate counter bit 29...16 patch 2 board 0 crate 0 \\\hline | 
|---|
| 832 | 0x00D & rate counter bit 15...0 patch 2 board 0 crate 0 \\\hline | 
|---|
| 833 | 0x00E & rate counter bit 29...16 patch 3 board 0 crate 0 \\\hline | 
|---|
| 834 | 0x00F & rate counter bit 15...0 patch 3 board 0 crate 0 \\\hline | 
|---|
| 835 | 0x010 & rate counter bit 29...16 total board 0 crate 0 \\\hline | 
|---|
| 836 | 0x011 & rate counter bit 15...0 total board 0 crate 0\\\hline | 
|---|
| 837 | 0x012 & Overflow register board 0 crate 0 \\\hline | 
|---|
| 838 | 0x013 & CRC-error register board 0 crate 0 \\\hline | 
|---|
| 839 | 0x014 & rate counter bit 29...16 patch 0 board 1 crate 0 \\\hline | 
|---|
| 840 | 0x015 & rate counter bit 15...0 patch 0 board 1 crate 0 \\\hline | 
|---|
| 841 | 0x016 & rate counter bit 29...16 patch 1 board 1 crate 0 \\\hline | 
|---|
| 842 | 0x017 & rate counter bit 15...0 patch 1 board 1 crate 0 \\\hline | 
|---|
| 843 | 0x018 & rate counter bit 29...16 patch 2 board 1 crate 0 \\\hline | 
|---|
| 844 | 0x019 & rate counter bit 15...0 patch 2 board 1 crate 0 \\\hline | 
|---|
| 845 | 0x01A & rate counter bit 29...16 patch 3 board 1 crate 0 \\\hline | 
|---|
| 846 | 0x01B & rate counter bit 15...0 patch 3 board 1 crate 0 \\\hline | 
|---|
| 847 | 0x01C & rate counter bit 29...16 total board 1 crate 0 \\\hline | 
|---|
| 848 | 0x01D & rate counter bit 15...0 total board 1 crate 0  \\\hline | 
|---|
| 849 | 0x01E & Overflow register board 1 crate 0 \\\hline | 
|---|
| 850 | 0x01F & CRC-error register board 1 crate 0 \\\hline | 
|---|
| 851 | ... & ... \\\hline | 
|---|
| 852 | 0x1E7 & 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} | 
|---|
| 929 | When the FTM board receives the 'ping all FTUs' instruction, it sends a ping | 
|---|
| 930 | command to all FTU boards and gathers the FTU boards responses to a list. This | 
|---|
| 931 | list is called 'FTU list' and shown in table \ref{tab:FTU-list}. When the FTU | 
|---|
| 932 | list is complete, it is sent back via ethernet with the header defined in | 
|---|
| 933 | table~\ref{tab:FTM-header}. | 
|---|
| 934 |  | 
|---|
| 935 | \begin{longtable}[!h]{|l|l|}\hline | 
|---|
| 936 | address & content\\\hline\hline | 
|---|
| 937 | 0x000 & total number of responding FTU boards\\\hline | 
|---|
| 938 | 0x001 & number of responding FTU boards belonging to crate 0 \\\hline | 
|---|
| 939 | 0x002 & number of responding FTU boards belonging to crate 1 \\\hline | 
|---|
| 940 | 0x003 & number of responding FTU boards belonging to crate 2 \\\hline | 
|---|
| 941 | 0x004 & number of responding FTU boards belonging to crate 3 \\\hline | 
|---|
| 942 | 0x005 & active FTU list crate 0 \\\hline | 
|---|
| 943 | 0x006 & active FTU list crate 1 \\\hline | 
|---|
| 944 | 0x007 & active FTU list crate 2 \\\hline | 
|---|
| 945 | 0x008 & active FTU list crate 3 \\\hline | 
|---|
| 946 | 0x009 & address of first FTU board and number of sent pings until response\\\hline | 
|---|
| 947 | 0x00A & DNA of first FTU board bit 63 ... 48\\\hline | 
|---|
| 948 | 0x00B & DNA of first FTU board bit 47 ... 32\\\hline | 
|---|
| 949 | 0x00C & DNA of first FTU board bit 31 ... 16\\\hline | 
|---|
| 950 | 0x00D & DNA of first FTU board bit 15 ... 0\\\hline | 
|---|
| 951 | 0x00E & CRC error counter reading of first FTU board\\\hline | 
|---|
| 952 | 0x00F & address of second FTU board and number of sent pings until response\\\hline | 
|---|
| 953 | 0x010 & DNA of second FTU board bit 63 ... 48\\\hline | 
|---|
| 954 | 0x011 & DNA of second FTU board bit 47 ... 32\\\hline | 
|---|
| 955 | 0x012 & DNA of second FTU board bit 31 ... 16\\\hline | 
|---|
| 956 | 0x013 & DNA of second FTU board bit 15 ... 0\\\hline | 
|---|
| 957 | 0x014 & CRC error counter reading of second FTU board\\\hline | 
|---|
| 958 | ... & ...\\\hline | 
|---|
| 959 | 0x0F8 & CRC error counter reading of last FTU board\\\hline | 
|---|
| 960 | \caption{FTU list} | 
|---|
| 961 | \label{tab:FTU-list} | 
|---|
| 962 | \end{longtable} | 
|---|
| 963 |  | 
|---|
| 964 | In case there is no response to a 'ping' for a certain FTU address, there are | 
|---|
| 965 | up to two repetitions. If there is still no answer, only zeros are written | 
|---|
| 966 | into the FTU list for this particular board. A responding FTU board gets a | 
|---|
| 967 | regular entry, including the number of 'ping' sent until response. The number | 
|---|
| 968 | of 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' | 
|---|
| 970 | contain the number of 'pings' until response of an FTU board (coded in | 
|---|
| 971 | binary). 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 | 
|---|
| 973 | bit serial number unambiguously identifying every Xilinx FPGA. In the most | 
|---|
| 974 | significant 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 | 
|---|
| 979 | Bit      & 15 ... 10 & 9 & 8 & 7 & 6 & 5 & ... & 0 \\\hline | 
|---|
| 980 | Content & 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 |  | 
|---|
| 990 | When the FTM board is communicating with a FTU board via RS-485, the FTU board | 
|---|
| 991 | has to respond within 2\,ms (after the last byte was transmitted). If this | 
|---|
| 992 | timeout expires, or the response sent back by the FTU board is incorrect, the | 
|---|
| 993 | FTM resends the datapacket after the timeout. If this second attempt is still | 
|---|
| 994 | unsuccessful, a third and last attempt will be made by the FTM board. An error | 
|---|
| 995 | message will be sent to the FTMcontrol whenever a FTU board does not send a | 
|---|
| 996 | correct answer after the first call by the FTM board. This message (see | 
|---|
| 997 | table~\ref{tab:error-message}) contains, after the standard header (see | 
|---|
| 998 | table~\ref{tab:FTM-header}), the number of calls until response (0 if no | 
|---|
| 999 | response at all), and the corresponding data packet which was sent to the FTU | 
|---|
| 1000 | board. In order to avoid massive error messages for e.g. test setups with | 
|---|
| 1001 | single FTUs, the 'active FTU list' can be employed to disable FTUs from the | 
|---|
| 1002 | bus. 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} | 
|---|
| 1024 | Paul 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} | 
|---|
| 1030 | National Semiconductor Corporation. | 
|---|
| 1031 | \newblock {\em LMK03000 Family Precision Clock Conditioner with integrated | 
|---|
| 1032 | VCO}, 2008. | 
|---|
| 1033 | \newblock datasheet. | 
|---|
| 1034 |  | 
|---|
| 1035 | \bibitem{FTM-Schematics} | 
|---|
| 1036 | ETH Z{\"u}rich, IPP. | 
|---|
| 1037 | \newblock {\em FTM Schematics}, 2010. | 
|---|
| 1038 |  | 
|---|
| 1039 | \bibitem{W5300} | 
|---|
| 1040 | WIZnet Co.Ltd. | 
|---|
| 1041 | \newblock {\em W5300 Fully Hardwired Network protocol Embedded Ethernet | 
|---|
| 1042 | Controller}, 2008. | 
|---|
| 1043 | \newblock datasheet. | 
|---|
| 1044 |  | 
|---|
| 1045 | \bibitem{ds557} | 
|---|
| 1046 | Xilinx. | 
|---|
| 1047 | \newblock {\em Spartan-3AN FPGA Family Data Sheet}, 2009. | 
|---|
| 1048 |  | 
|---|
| 1049 | \bibitem{ds610} | 
|---|
| 1050 | Xilinx. | 
|---|
| 1051 | \newblock {\em Spartan-3A DSP FPGA Family: Data Sheet}, 2009. | 
|---|
| 1052 |  | 
|---|
| 1053 | \bibitem{wp267} | 
|---|
| 1054 | Xilinx. | 
|---|
| 1055 | \newblock {\em Advanced Security Schemes for Spartan-3A/3AN/3A DSP FPGAs}, | 
|---|
| 1056 | 2007. | 
|---|
| 1057 |  | 
|---|
| 1058 | \bibitem{wp266} | 
|---|
| 1059 | Xilinx. | 
|---|
| 1060 | \newblock {\em Security Solutions Using Spartan-3 Generation FPGAs}, 2008. | 
|---|
| 1061 |  | 
|---|
| 1062 | \bibitem{MAX6662} | 
|---|
| 1063 | Maxim 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} | 
|---|
| 1069 | ETH Z{\"u}rich, IPP. | 
|---|
| 1070 | \newblock {\em FTU Firmware Specifications v3}, 2010. | 
|---|
| 1071 |  | 
|---|
| 1072 |  | 
|---|
| 1073 | \bibitem{FLD-Schematics} | 
|---|
| 1074 | ETH Z{\"u}rich, IPP. | 
|---|
| 1075 | \newblock {\em FLD Schematics, FACT light driver}, 2010. | 
|---|
| 1076 |  | 
|---|
| 1077 |  | 
|---|
| 1078 | \end{thebibliography} | 
|---|
| 1079 |  | 
|---|
| 1080 | \end{document} | 
|---|