From a9f7e6ae72161a8178282ce05fd3fb4a2f8d6793 Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 4 Jul 2012 11:59:40 +0000 Subject: [PATCH] *** empty log message *** --- trb3/TdcBuildingBlocks.tex | 38 +++++++++++----------- trb3/TdcDataFormat.tex | 65 +++++++++++++++++++++++++------------- trb3/biblio.bib | 10 +++--- trb3/main.tex | 4 +-- 4 files changed, 69 insertions(+), 48 deletions(-) diff --git a/trb3/TdcBuildingBlocks.tex b/trb3/TdcBuildingBlocks.tex index 60736c9..a96094b 100644 --- a/trb3/TdcBuildingBlocks.tex +++ b/trb3/TdcBuildingBlocks.tex @@ -5,12 +5,12 @@ \end{center} \vspace{-0.5cm} \caption{Diagram of a channel.} - \label{fig:tdc_channel_block} + \label{fig:tdcChannelBlock} \end{wrapfigure} -The architecture of the TDC consists of a fine time measurement block, a coarse counter with granularity of 5~ns, an encoder for the conversion of the result to binary number and a First-In-First-Out (FIFO) memory block for data storage. A block diagram of the designed TDC is shown in Figure~\ref{fig:tdc_channel_block}. +The architecture of the TDC consists of a fine time measurement block, a coarse counter with granularity of 5~ns, an encoder for the conversion of the result to binary number and a First-In-First-Out (FIFO) memory block for data storage. A block diagram of the designed TDC is shown in Figure~\ref{fig:tdcChannelBlock}. -In each TDC channel the measurement result of the fine time measurement block is converted to a binary number in the encoder and saved in the FIFO with a coarse time flag. The time interval between different signals measured at different channels can be calculated by simply taking the difference of the relevant measurement results. In Figure~\ref{fig:tdc_delta_time} an example of two signals, their coarse and fine time values and the calculation of the time interval between these signals are shown. +In each TDC channel the measurement result of the fine time measurement block is converted to a binary number in the encoder and saved in the FIFO with a coarse time flag. The time interval between different signals measured at different channels can be calculated by simply taking the difference of the relevant measurement results. In Figure~\ref{fig:tdcDeltaTime} an example of two signals, their coarse and fine time values and the calculation of the time interval between these signals are shown. \begin{figure}[htb] %% LARGER SUBFIGURE @@ -19,7 +19,7 @@ In each TDC channel the measurement result of the fine time measurement block is \begin{minipage}[1\width]{0.45\textwidth} \centering \includegraphics[width=0.9\textwidth]{figures/t_diff_diagram.eps} - \label{fig:tdc_time_diff} + \label{fig:tdcTimeDiff} \end{minipage}} %% SMALLER SUBFIGURE \subfloat[]{% @@ -28,48 +28,48 @@ In each TDC channel the measurement result of the fine time measurement block is \Delta t &= t_{hit_1} - t_{hit_2} = (t_{c1} - t_{f1}) - (t_{c2} - t_{f2})\\ &= (t_{c1} - t_{c2}) - (t_{f1} - t_{f2}) \end{align*} - \label{eq:tdc_delta_t} + \label{eq:tdcDeltaT} \end{minipage}} \vspace{-0.2cm} - \caption{\subref{fig:tdc_time_diff} Illustration of two time measurements and \subref{eq:tdc_delta_t} calculation of the time interval between them.} - \label{fig:tdc_delta_time} + \caption{\subref{fig:tdcTimeDiff} Illustration of two time measurements and \subref{eq:tdcDeltaT} calculation of the time interval between them.} + \label{fig:tdcDeltaTime} \end{figure} \subsubsection{Fine Time Measurement} -\label{sec:fine_time} +\label{sec:FineTime} -For fine time measurements the Tapped Delay Line (TDL) method is used. This method is based on a delay path with delay elements, which have similar propagation delays. With the start signal the propagation along the delay line starts and with the stop signal the output of the each delay element is latched (Figure~\ref{fig:tdc_tdl}). The location of the propagating signal along the delay line defines the fine time between start and stop signals. +For fine time measurements the Tapped Delay Line (TDL) method is used. This method is based on a delay path with delay elements, which have similar propagation delays. With the start signal the propagation along the delay line starts and with the stop signal the output of the each delay element is latched (Figure~\ref{fig:tdcTdl}). The location of the propagating signal along the delay line defines the fine time between start and stop signals. -The delay line is realised on the dedicated carry chain structure of the Lattice FPGA using the 4-bit Look Up Tables (LUT) and the registers, as delay elements and as latches respectively. In Figure~\ref{fig:tdc_slice} the diagram of a slice with 2 LUTs and 2 registers is shown. +The delay line is realised on the dedicated carry chain structure of the Lattice FPGA using the 4-bit Look Up Tables (LUT) and the registers, as delay elements and as latches respectively. In Figure~\ref{fig:tdcSlice} the diagram of a slice with 2 LUTs and 2 registers is shown. \begin{figure}[htb] %% SMALLER SUBFIGURES \begin{minipage}[1\width]{0.45\textwidth}% \centering - \subfloat[Tapped Delay Line.\cite{tdc_review}]{% + \subfloat[Tapped Delay Line.\cite{tdcReview}]{% \includegraphics[width=0.98\textwidth]{figures/tdl.eps} - \label{fig:tdc_tdl}}\\ + \label{fig:tdcTdl}}\\ \vspace{0.9cm} - \subfloat[Tapped Delay Line realised with full adders.\cite{tdc_fa_ref}]{% + \subfloat[Tapped Delay Line realised with full adders.\cite{tdcFaRef}]{% \includegraphics[width=0.98\textwidth]{figures/adder.eps} - \label{fig:tdc_adder}} + \label{fig:tdcAdder}} \end{minipage}% %% LARGER SUBFIGURE \begin{minipage}[1\width]{0.55\textwidth}% \centering - \subfloat[Lattice FPGA slice diagram.\cite{tdc_fpga_hb}]{% + \subfloat[Lattice FPGA slice diagram.\cite{tdcFpgaHb}]{% \includegraphics[width=0.95\textwidth]{figures/slice.eps} - \label{fig:tdc_slice}} + \label{fig:tdcSlice}} \end{minipage} \caption{Look Up Tables programmed as full adders along the carry chain are used as delay elements of Tapped Delay Line and their outputs are registered at the registers located at the same slice.} - \label{fig:tdc_tdl_slice} + \label{fig:tdcTdlSlice} \end{figure} In the designed TDC the stop signal is defined as the next rising edge of the system clock after the start signal. As the maximum time interval to be measured by the fine time counter is one clock cycle, the total propagation time of the carry signal, along the delay line, has to be longer than a clock period. Manual placement of the delay elements and the corresponding registers are done in order to achieve a uniform delay along the line. The propagation delay of a delay cell depends on temperature and the consistency of the power supply. This dependency effects the resolution of the TDC. In order to overcome this problem, the output data of the TDC has to be calibrated. -For an FPGA TDC, digital calibration has to be applied to the raw data. Bin-by-bin calibration\cite{tdc_bin_calibration} is suitable for this purpose. In this method a DNL histogram is created for a given number of hits. Assuming the hit signals are completely random and not correlated with the clock signal, the hits should be equally distributed over the time interval of the fine interpolator, which is the clock period. Then the bin width can be calculated from, +For an FPGA TDC, digital calibration has to be applied to the raw data. Bin-by-bin calibration\cite{tdcBinCalibration} is suitable for this purpose. In this method a DNL histogram is created for a given number of hits. Assuming the hit signals are completely random and not correlated with the clock signal, the hits should be equally distributed over the time interval of the fine interpolator, which is the clock period. Then the bin width can be calculated from, \begin{equation} BW=n\times\frac{T_o}{N} \end{equation} @@ -78,7 +78,7 @@ where $n$ is the actual number of hits of the bin and $N$ is the total number of \begin{figure}[htp] \centering \includegraphics[width=0.8\textwidth]{figures/Calibration_2.pdf} - \caption[An example of a LUT created by the bin-by-bin calibration method]{An example of a LUT created by the bin-by-bin calibration method (Adapted from \cite{tdc_Wu_waveunion})} + \caption[An example of a LUT created by the bin-by-bin calibration method]{An example of a LUT created by the bin-by-bin calibration method (Adapted from \cite{tdcWuWaveunion})} \label{fig:calibration} \end{figure} diff --git a/trb3/TdcDataFormat.tex b/trb3/TdcDataFormat.tex index fff3fb0..7f68312 100644 --- a/trb3/TdcDataFormat.tex +++ b/trb3/TdcDataFormat.tex @@ -1,4 +1,4 @@ -In the data stream of the DAQ system, the TDC data starts with the TDC network header ``0xXXXXc0XX'', ``0xc0XX'' indicating the address of the TDC in the system. The bits 4\textendash7 indicates the number of the TRB3 board in the system starting from 0 (This must be set up in the \textit{addresses\_trb3.db} file). The least significant 4 bits indicate the TDC number on the TRB3 board. It can alter between 1\textendash4. The number of words sent by the TDC is marked in the upper 16 bits, e.g., ``0x0006c0XX'' means, the next 6 words are from the TDC with the address XX. After the TDC header, the data is sent. 4 different kinds of words are sent by the TDCs; header, time data, debug and reserved. +In the data stream of the DAQ system, the TDC data starts with the TDC network header "0xXXXXc0XX", "0xc0XX" indicating the address of the TDC in the system. The bits 4\textendash7 indicates the number of the TRB3 board in the system starting from 0 (This must be set up in the \textit{addresses\_trb3.db} file). The least significant 4 bits indicate the TDC number on the TRB3 board. It can alter between 1\textendash4. The number of words sent by the TDC is marked in the upper 16 bits, e.g., "0x0006c0XX" means, the next 6 words are from the TDC with the address XX. After the TDC header, the data is sent. 4 different kinds of words are sent by the TDCs; header, time data, debug and reserved. \subsubsection{TDC HEADER} @@ -6,27 +6,45 @@ The data format of the \textbf{\textit{header}} word is shown below: \begin{table}[h] \centering - \begin{tabular}{|c|c|c|c|} + \begin{tabular}{|C{1.2cm}|C{2cm}|C{3.2cm}|C{6.3cm}|} \hline - ``001'' & reserved & random code & error bits \\ + 3 bits & 5 bits & 8 bits & 16 bits\\ + "001" & reserved & random code & error bits\\ \hline \end{tabular} \caption{The data format of the \textit{TDC HEADER} word.} - \label{tab:tdc_header_word} + \label{tab:tdcHeaderWord} \end{table} \begin{tabbing} - “001” \hspace{1.5cm}\= 3 bits \hspace{1.5cm}\= TDC Header marker \\ + "001" \hspace{1.5cm}\= 3 bits \hspace{1.5cm}\= TDC Header marker \\ reserved \> 5 bits \> Reserved for future use \\ - random code \> 8bits \> Random code for the individual trigger \\ + random code \> 8 bits \> Random code for the individual trigger \\ error bits \> 16 bits \> Error might occur will be marked here \\ \end{tabbing} -Any word starting with the bits ``001'' indicates a header word from the TDC in the system. The TDC is defined with the previous word in the data stream \textendash\ TDC network header, e.g., ``0xXXXXc023'': 3rd TDC of the 2nd TRB3 board in the system. +Any word starting with the bits "001" indicates a header word from the TDC in the system. The TDC is defined with the previous word in the data stream \textendash\ TDC network header, e.g., "0xXXXXc023": 3rd TDC of the 2nd TRB3 board in the system. The trigger random code \textendash\ 8 bits \textendash\ is generated by the trbnet for each trigger in order to distinguish the trigger. It is repeated in the TDC HEADER, so data \& trigger matching can be tested. -The error bits are used to indicate any error might occured in the TDC since the last trigger. +The error bits are used to indicate any error might occured in the TDC since the last trigger. The error bits coded in the header is given in Table \ref{tab:tdcHeaderErrorBits} + +\begin{table}[h] + \centering + \begin{tabular}{|c|l|} + \hline + Bit & \multicolumn{1}{|c|}{Explanation} \\ + \hline + 0 & Reserved. \\ + 1 & At least one of the channel FIFOs is full. \\ + 2 & At least one of the channel FIFOs has more than 28 data words. \\ + 3-15 & Reserved. \\ + \hline + \end{tabular} + \caption{TDC Header Error bits.} + \label{tab:tdcHeaderErrorBits} +\end{table} + \subsubsection{TIME DATA} @@ -34,17 +52,18 @@ The data format of the \textbf{\textit{time data}} word is shown below: \begin{table}[h] \centering - \begin{tabular}{|c|c|c|c|c|c|} + \begin{tabular}{|C{0.7cm}|C{1.5cm}|C{1.98cm}|C{3.3cm}|C{0.73cm}|C{3.63cm}|} \hline - ``1'' & reserved & channel no & fine time & edge & coarse time \\ + 1 bit & 3 bits & 6 bits & 10 bits & 1 bit & 11 bits\\ + "1" & reserved & channel no & fine time & edge & coarse time\\ \hline \end{tabular} \caption{The data format of the \textit{TIME DATA} word.} - \label{tab:tdc_time_data_word} + \label{tab:tdcTimeDataWord} \end{table} \begin{tabbing} - “1” \hspace{1.5cm}\= 1 bit \hspace{1.5cm}\= Time Data marker \\ + "1" \hspace{1.5cm}\= 1 bit \hspace{1.5cm}\= Time Data marker \\ reserved \> 3 bits \> Reserved for future use \\ channel no \> 6 bits \> 6 bits The channel number of the TDC \textendash\ “000000” is the reference channel \\ fine time \> 10 bits \> The fine time value of the measurement \\ @@ -52,11 +71,11 @@ The data format of the \textbf{\textit{time data}} word is shown below: coarse time \> 11 bits \> The coarse time value of the measurement \textendash\ 5~ns granularity \\ \end{tabbing} -Any word starting with the bit ``1'' indicates a time data word from the TDC in the system. +Any word starting with the bit "1" indicates a time data word from the TDC in the system. -6 bits are reserved for indicating the channel number in the TDC (max. 63). The first channel \textendash\ channel ``000000'' \textendash\ is used to measure the reference time. All TDCs in the system measure the same reference time in this channel, so that they can be all synchronised. +6 bits are reserved for indicating the channel number in the TDC (max. 63). The first channel \textendash\ channel "000000" \textendash\ is used to measure the reference time. All TDCs in the system measure the same reference time in this channel, so that they can be all synchronised. -Two time informations are generated for each event detected by each channel. The coarse time information has the granularity of 5~ns (period of the system clock). The range of the coarse time is 10,24~us. The fine time has the range of 5~ns but doesn't have a fixed granularity. The fine time information has to be calibrated using the statistic collected by the individual channel (for details see \ref{sec:fine_time}). +Two time informations are generated for each event detected by each channel. The coarse time information has the granularity of 5~ns (period of the system clock). The range of the coarse time is 10,24~us. The fine time has the range of 5~ns but doesn't have a fixed granularity. The fine time information has to be calibrated using the statistic collected by the individual channel (for details see \ref{sec:FineTime}). \subsubsection{DEBUG} @@ -64,17 +83,18 @@ The data format of the \textbf{\textit{debug}} word is shown below: \begin{table}[h] \centering - \begin{tabular}{|c|c|c|} + \begin{tabular}{|C{1.275cm}|C{2.125cm}|C{9.7cm}|} \hline - ``010'' & debug mode & debug bits \\ + 3 bits & 5 bits & 24 bits\\ + "010" & debug mode & debug bits\\ \hline \end{tabular} \caption{The data format of the \textit{DEBUG} word.} - \label{tab:tdc_debug_word} + \label{tab:tdcDebugWord} \end{table} \begin{tabbing} - “010” \hspace{1.5cm}\= 3 bits \hspace{1.5cm}\= Debug marker \\ + "010" \hspace{1.5cm}\= 3 bits \hspace{1.5cm}\= Debug marker \\ debug mode \> 5 bits \> It is used to define the different debug bits \\ debug bits \> 24 bits \> Debug information and statistics to the user \\ \end{tabbing} @@ -85,13 +105,14 @@ The data format of the \textbf{\textit{reserved}} word is shown below: \begin{table}[h] \centering - \begin{tabular}{|c|c|} + \begin{tabular}{|C{1.275cm}|C{12.325cm}|} \hline - ``011'' & reserved \\ + 3 bits & 29 bits\\ + "011" & reserved\\ \hline \end{tabular} \caption{The data format of the \textit{RESERVED} word.} - \label{tab:tdc_reserved_word} + \label{tab:tdcReservedWord} \end{table} It is reserved for future use. \ No newline at end of file diff --git a/trb3/biblio.bib b/trb3/biblio.bib index 4029aae..5188bb3 100644 --- a/trb3/biblio.bib +++ b/trb3/biblio.bib @@ -1,4 +1,4 @@ -@article{tdc_bin_calibration, +@article{tdcBinCalibration, author = "R. Szplet and J. Kalisz and R. Pelka", title = "Nonlinearity correction of the integrated time-to-digital converter with direct coding", journal = "IEEE Transactions on Instrumentation and Measurement", @@ -8,7 +8,7 @@ year = "1997" } -@article{tdc_Wu_waveunion, +@article{tdcWuWaveunion, author = "J. Wu and Z. Shi", title = "The 10-ps wave union TDC: Improving FPGA TDC resolution beyond its cell delay", year = "2008", @@ -17,7 +17,7 @@ pages = "3440--3446" } -@article{tdc_review, +@article{tdcReview, author = "J. Kalisz", title = "Review of methods for time interval measurements with picosecond resolution", journal = "Metrologia", @@ -28,7 +28,7 @@ year = "2004" } -@article{tdc_fa_ref, +@article{tdcFaRef, author = "J. Song and Q. An and S. Liu", title = "A high-resolution time-to-digital converter implemented in field-programmable-gate-array", year = "2006", @@ -40,7 +40,7 @@ url = "http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=5738332" } -@manual{tdc_fpga_hb, +@manual{tdcFpgaHb, title = "LatticeECP2/M family handbook", organization = "Lattice Semiconductor Corporation", note = "HB1003 Version 04.3", diff --git a/trb3/main.tex b/trb3/main.tex index 752e8c2..378b1d6 100755 --- a/trb3/main.tex +++ b/trb3/main.tex @@ -40,8 +40,8 @@ urlcolor=darkblue]{hyperref} \usepackage{cite} - -\newcolumntype{C}{>{\centering\arraybackslash}X} +\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} +% \newcolumntype{C}{>{\centering\arraybackslash}X} \usepackage{fancyhdr} \pagestyle{headings}%{fancy} -- 2.43.0