Commit 3173b753 authored by Denia Bouhired-Ferrag's avatar Denia Bouhired-Ferrag

DOC: wip unfinished modifications of gateware guide

parent 4d40bcc3
......@@ -17,54 +17,69 @@ Base address: 0x000
\endhead
\hline
\endfoot
0x0 & 0x54343835 & BIDR & Board ID Register\\
0x4 & (1) & SR & Status Register\\
0x8 & 0x00000000 & CR & Control Register\\
0xc & 0x00000000 & CH1PCR & Channel 1 Pulse Counter Register\\
0x10 & 0x00000000 & CH2PCR & Channel 2 Pulse Counter Register\\
0x14 & 0x00000000 & CH3PCR & Channel 3 Pulse Counter Register\\
0x18 & 0x00000000 & CH4PCR & Channel 4 Pulse Counter Register\\
0x1c & 0x00000000 & CH5PCR & Channel 5 Pulse Counter Register\\
0x20 & 0x00000000 & CH6PCR & Channel 6 Pulse Counter Register\\
0x24 & 0x00000000 & TVLR & Time Value Low Register\\
0x28 & 0x00000000 & TVHR & Time Value High Register\\
0x2c & 0x00000000 & TBMR & Tag Buffer Meta Register\\
0x30 & 0x00000000 & TBCYR & Tag Buffer Cycles Register\\
0x34 & 0x00000000 & TBTLR & Tag Buffer TAI Low Register\\
0x38 & 0x00000000 & TBTHR & Tag Buffer TAI High Register\\
0x3c & 0x00020000 & TBCSR & Tag Buffer Control and Status Register\\
0x40 & 0x00000000 & CH1LTSCYR & Channel 1 Latest Timestamp Cycles Register\\
0x44 & 0x00000000 & CH1LTSTLR & Channel 1 Latest Timestamp TAI Low Register\\
0x48 & 0x00000000 & CH1LTSTHR & Channel 1 Latest Timestamp TAI High Register\\
0x4c & 0x00000000 & CH2LTSCYR & Channel 2 Latest Timestamp Cycles Register\\
0x50 & 0x00000000 & CH2LTSTLR & Channel 2 Latest Timestamp TAI Low Register\\
0x54 & 0x00000000 & CH2LTSTHR & Channel 2 Latest Timestamp TAI High Register\\
0x58 & 0x00000000 & CH3LTSCYR & Channel 3 Latest Timestamp Cycles Register\\
0x5c & 0x00000000 & CH3LTSTLR & Channel 3 Latest Timestamp TAI Low Register\\
0x60 & 0x00000000 & CH3LTSTHR & Channel 3 Latest Timestamp TAI High Register\\
0x64 & 0x00000000 & CH4LTSCYR & Channel 4 Latest Timestamp Cycles Register\\
0x68 & 0x00000000 & CH4LTSTLR & Channel 4 Latest Timestamp TAI Low Register\\
0x6c & 0x00000000 & CH4LTSTHR & Channel 4 Latest Timestamp TAI High Register\\
0x70 & 0x00000000 & CH5LTSCYR & Channel 5 Latest Timestamp Cycles Register\\
0x74 & 0x00000000 & CH5LTSTLR & Channel 5 Latest Timestamp TAI Low Register\\
0x78 & 0x00000000 & CH5LTSTHR & Channel 5 Latest Timestamp TAI High Register\\
0x7c & 0x00000000 & CH6LTSCYR & Channel 6 Latest Timestamp Cycles Register\\
0x80 & 0x00000000 & CH6LTSTLR & Channel 6 Latest Timestamp TAI Low Register\\
0x84 & 0x00000000 & CH6LTSTHR & Channel 6 Latest Timestamp TAI High Register\\
0x88 & (2) & LSR & Line Status Register\\
0x8c & 0x00000000 & OSWR & Other Switches Register\\
0x0& 0x54343835 & BIDR & Board ID Register\\
0x4& Note(1)& SR & Status Register\\
0x8& 0x00000000 & ERR & Error Register\\
0xc& 0x00000000 & CR & Control Register\\
0x10& 0x00000000 & CH1FPPCR & Channel 1 TTL Pulse Counter Register\\
0x14& 0x00000000 & CH2FPPCR & Channel 2 TTL Pulse Counter Register\\
0x18& 0x00000000 & CH3FPPCR & Channel 3 TTL Pulse Counter Register\\
0x1c& 0x00000000 & CH4FPPCR & Channel 4 TTL Pulse Counter Register\\
0x20& 0x00000000 & CH5FPPCR & Channel 5 TTL Pulse Counter Register\\
0x24& 0x00000000 & CH6FPPCR & Channel 6 TTL Pulse Counter Register\\
0x28& 0x00000000 & CH1RPPCR & Channel 1 BLO Pulse Counter Register\\
0x2c& 0x00000000 & CH2RPPCR & Channel 2 BLO Pulse Counter Register\\
0x30& 0x00000000 & CH3RPPCR & Channel 3 BLO Pulse Counter Register\\
0x34& 0x00000000 & CH4RPPCR & Channel 4 BLO Pulse Counter Register\\
0x38& 0x00000000 & CH5RPPCR & Channel 5 BLO Pulse Counter Register\\
0x3c& 0x00000000 & CH6RPPCR & Channel 6 BLO Pulse Counter Register\\
0x40& 0x00000000 & TVLR & Time Value Low Register\\
0x44& 0x00000000 & TVHR & Time Value High Register\\
0x48& 0x00000000 & TBMR & Tag Buffer Meta Register\\
0x4c& 0x00000000 & TBCYR & Tag Buffer Cycles Register\\
0x50& 0x00000000 & TBTLR & Tag Buffer TAI Low Register\\
0x54& 0x00000000 & TBTHR & Tag Buffer TAI High Register\\
0x58& 0x00020000 & TBCSR & Tag Buffer Control and Status Register\\
0x5c& 0x00000000 & CH1LTSCYR & Channel 1 Latest Timestamp Cycles Register\\
0x60& 0x00000000 & CH1LTSTLR & Channel 1 Latest Timestamp TAI Low Register\\
0x64& 0x00000000 & CH1LTSTHR & Channel 1 Latest Timestamp TAI High Register\\
0x68& 0x00000000 & CH2LTSCYR & Channel 2 Latest Timestamp Cycles Register\\
0x6c& 0x00000000 & CH2LTSTLR & Channel 2 Latest Timestamp TAI Low Register\\
0x70& 0x00000000 & CH2LTSTHR & Channel 2 Latest Timestamp TAI High Register\\
0x74& 0x00000000 & CH3LTSCYR & Channel 3 Latest Timestamp Cycles Register\\
0x78& 0x00000000 & CH3LTSTLR & Channel 3 Latest Timestamp TAI Low Register\\
0x7c& 0x00000000 & CH3LTSTHR & Channel 3 Latest Timestamp TAI High Register\\
0x80& 0x00000000 & CH4LTSCYR & Channel 4 Latest Timestamp Cycles Register\\
0x84& 0x00000000 & CH4LTSTLR & Channel 4 Latest Timestamp TAI Low Register\\
0x88& 0x00000000 & CH4LTSTHR & Channel 4 Latest Timestamp TAI High Register\\
0x8c& 0x00000000 & CH5LTSCYR & Channel 5 Latest Timestamp Cycles Register\\
0x90& 0x00000000 & CH5LTSTLR & Channel 5 Latest Timestamp TAI Low Register\\
0x94& 0x00000000 & CH5LTSTHR & Channel 5 Latest Timestamp TAI High Register\\
0x98& 0x00000000 & CH6LTSCYR & Channel 6 Latest Timestamp Cycles Register\\
0x9c& 0x00000000 & CH6LTSTLR & Channel 6 Latest Timestamp TAI Low Register\\
0xa0& 0x00000000 & CH6LTSTHR & Channel 6 Latest Timestamp TAI High Register\\
0xa4& Note(2) & LSR & Line Status Register\\
0xa8& 0x00000000 & OSWR & Other switch register\\
0xac& Unique ID & UIDLR & Thermometer ID Low register\\
0xb0& Unique ID & UIDHR & Thermometer ID High register\\
0xb4& 0x00000000 & TEMPR & Board Temperature Register\\
\hline
\end{longtable}
}
\noindent Note (1): The reset value of the SR cannot be specified, since it is based on the
gateware version, the state of the on-board switches and whether an RTM is plugged in or not.
\noindent Note (2): The reset value of the LSR cannot be specified, since it depends on whether a cable
is plugged into the channel or not.
\vspace{11pt}
\subsubsection{BIDR -- Board ID Register}
\label{app:conv-regs-bidr}
\label{app:conv-regs-BIDR}
\vspace{11pt}
\noindent
......@@ -95,27 +110,30 @@ is plugged into the channel or not.
BIDR
} [\emph{read-only}]: ID register bits
\\
Reset value: 0x54343835
Reset value: 0x54424c4f
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{SR -- Status Register}
\label{app:conv-regs-sr}
\label{app:conv-regs-SR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & - & - & - & \multicolumn{1}{|c|}{\cellcolor{gray!25}I2C\_ERR}\\
\multicolumn{1}{|c}{-} & - & - & \multicolumn{1}{|c|}{\cellcolor{gray!25}WRPRES} & \multicolumn{4}{|c|}{\cellcolor{gray!25}HWVERS[5:2]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{1}{|c|}{-} & \multicolumn{1}{|c|}{\cellcolor{gray!25}I2C\_WDTO} & \multicolumn{6}{|c|}{\cellcolor{gray!25}RTM[5:0]}\\
\multicolumn{2}{|c|}{\cellcolor{gray!25}HWVERS[1:0]} & \multicolumn{6}{|c|}{\cellcolor{gray!25}RTM[5:0]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
......@@ -141,17 +159,60 @@ Leftmost nibble hex value is major release decimal value \\
SWITCHES
} [\emph{read-only}]: Status of on-board general-purpose switches
\\
1 -- switch is ON \\ 0 -- switch is OFF
Eg: SW1.1-- SR.SWITCHES[0] \\ SW1.2-- SR.SWITCHES[1] \\ SW2.1-- SR.SWITCHES[4] \\ SW2.4-- SR.SWITCHES[7] \\ 1 -- switch is ON \\ 0 -- switch is OFF
\end{small}
\item \begin{small}
{\bf
RTM
} [\emph{read-only}]: RTM detection lines~\cite{rtm-det}
} [\emph{read-only}]: RTM detection lines cite{rtm-det}
\\
1 -- line active \\ 0 -- line inactive
1 bit per RTM output channel \\ 1 -- line active \\ 0 -- line inactive
\end{small}
\item \begin{small}
{\bf
HWVERS
} [\emph{read-only}]: Hardware version
\\
PCB version - Hardwired on the board \\ Only meaningful for HW v4.0 and over \\ Earlier versions show 0. The register \\ uses 4 bits for the version number and\\ 2 bits for the execution.\\ e.g. \\ 0x010001 -- hw v4.1 \\ 0x010111 -- hw v5.3 \\ 0x00-- hw v3 and earlier
\end{small}
\item \begin{small}
{\bf
WRPRES
} [\emph{read-only}]: White Rabbit present
\\
1 -- White Rabbit present \\ 0 -- White Rabbit not present
\end{small}
\end{itemize}
\subsubsection{ERR - Error Register}
\label{app:conv-regs-ERR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & - & - & - & \multicolumn{1}{c|}{-}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & - & - & - & \multicolumn{1}{c|}{-}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{1}{|c}{-} & - & \multicolumn{6}{|c|}{\cellcolor{gray!25}FWDG\_PMISSE[5:0]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{6}{|c|}{\cellcolor{gray!25}FLIM\_PMISSE[5:0]} & \multicolumn{1}{|c|}{\cellcolor{gray!25}I2C\_ERR} & \multicolumn{1}{|c|}{\cellcolor{gray!25}I2C\_WDTO}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
{\bf
I2C\_WDTO
} [\emph{read/write}]: I2C communication watchdog timeout error
\\
......@@ -165,14 +226,22 @@ I2C\_ERR
1 -- attempted to address non-existing address \\ 0 -- idle \\ This bit can be cleared by writing a '1' to it
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
{\bf
FLIM\_PMISSE
} [\emph{read/write}]: Frequency error
\\
1 -- Input above maximum supported frequency \\ 0 -- idle \\ Bit 0 -- channel 1 \\ Bit 1 -- channel 2 \\ etc. \\ Each bit can be cleared by writing a '1' to it
\end{small}
\item \begin{small}
{\bf
FWDG\_PMISSE
} [\emph{read/write}]: Frequency watchdog error
\\
1 -- Pulse over maximum pulse count for given frequency' \\ 0 -- idle \\ Bit 0 -- channel 1 \\ Bit 1 -- channel 2 \\ etc. \\ Each bit can be cleared by writing a '1' to it
\end{small}
\end{itemize}
\pagebreak
\subsubsection{CR -- Control Register}
\label{app:conv-regs-cr}
\subsubsection{CR - Control Register}
\label{app:conv-regs-CR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -207,7 +276,7 @@ RST\_UNLOCK
\item \begin{small}
{\bf
RST
} [\emph{read/write}]: Reset bit
} [\emph{read/write}]: Reset bit - active only if RST\_UNLOCK is 1
\\
1 -- initiate logic reset \\ 0 -- no reset
\end{small}
......@@ -222,29 +291,28 @@ Write the following sequence to trigger a pulse: \\ 0xde --
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH1PCR -- Channel 1 Pulse Counter Register}
\label{app:conv-regs-ch1pcr}
\subsubsection{CH1FPPCR - Channel 1 Pulse Counter Register for TTL pulses}
\label{app:conv-regs-CH1FPPCR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1PCR[31:24]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1FPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1PCR[23:16]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1FPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1PCR[15:8]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1FPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1PCR[7:0]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1FPPCR[7:0]}\\
\hline
\end{tabular}
}
......@@ -252,16 +320,14 @@ Write the following sequence to trigger a pulse: \\ 0xde --
\begin{itemize}
\item \begin{small}
{\bf
CH1PCR
} [\emph{read/write}]: Pulse counter value
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
CH1FPPCR
} [\emph{read/write}]: TTL pulse counter value
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH2PCR -- Channel 2 Pulse Counter Register}
\label{app:conv-regs-ch2pcr}
\subsubsection{CH2FPPCR - Channel 2 Pulse Counter Register for TTL pulses}
\label{app:conv-regs-CH2FPPCR}
\vspace{11pt}
\noindent
......@@ -269,19 +335,19 @@ CH1PCR
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2PCR[31:24]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2FPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2PCR[23:16]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2FPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2PCR[15:8]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2FPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2PCR[7:0]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2FPPCR[7:0]}\\
\hline
\end{tabular}
}
......@@ -289,16 +355,46 @@ CH1PCR
\begin{itemize}
\item \begin{small}
{\bf
CH2PCR
} [\emph{read/write}]: Pulse counter value
CH2FPPCR
} [\emph{read/write}]: TTL pulse counter value
\end{small}
\end{itemize}
\subsubsection{CH3FPPCR - Channel 3 Pulse Counter Register for TTL pulses}
\label{app:conv-regs-CH3FPPCR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3FPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3FPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3FPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3FPPCR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
{\bf
CH3FPPCR
} [\emph{read/write}]: TTL pulse counter value
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH3PCR -- Channel 3 Pulse Counter Register}
\label{app:conv-regs-ch3pcr}
\subsubsection{CH4FPPCR - Channel 4 Pulse Counter Register for TTL pulses}
\label{app:conv-regs-CH4FPPCR}
\vspace{11pt}
\noindent
......@@ -306,19 +402,19 @@ CH2PCR
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3PCR[31:24]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4FPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3PCR[23:16]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4FPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3PCR[15:8]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4FPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3PCR[7:0]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4FPPCR[7:0]}\\
\hline
\end{tabular}
}
......@@ -326,16 +422,46 @@ CH2PCR
\begin{itemize}
\item \begin{small}
{\bf
CH3PCR
} [\emph{read/write}]: Pulse counter value
CH4FPPCR
} [\emph{read/write}]: TTL pulse counter value
\end{small}
\end{itemize}
\subsubsection{CH5FPPCR - Channel 5 Pulse Counter Register for TTL pulses}
\label{app:conv-regs-CH5FPPCR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5FPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5FPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5FPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5FPPCR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
{\bf
CH5FPPCR
} [\emph{read/write}]: TTL pulse counter value
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH4PCR -- Channel 4 Pulse Counter Register}
\label{app:conv-regs-ch4pcr}
\subsubsection{CH6FPPCR - Channel 6 Pulse Counter Register for TTL pulses}
\label{app:conv-regs-CH6FPPCR}
\vspace{11pt}
\noindent
......@@ -343,19 +469,19 @@ CH3PCR
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4PCR[31:24]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6FPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4PCR[23:16]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6FPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4PCR[15:8]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6FPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4PCR[7:0]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6FPPCR[7:0]}\\
\hline
\end{tabular}
}
......@@ -363,16 +489,45 @@ CH3PCR
\begin{itemize}
\item \begin{small}
{\bf
CH4PCR
} [\emph{read/write}]: Pulse counter value
CH6FPPCR
} [\emph{read/write}]: TTL pulse counter value
\end{small}
\end{itemize}
\subsubsection{CH1RPPCR - Channel 1 Pulse Counter Register for BLO pulses}
\label{app:conv-regs-CH1RPPCR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1RPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1RPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1RPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH1RPPCR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
{\bf
CH1RPPCR
} [\emph{read/write}]: BLO pulse counter value
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH5PCR -- Channel 5 Pulse Counter Register}
\label{app:conv-regs-ch5pcr}
\subsubsection{CH2RPPCR - Channel 2 Pulse Counter Register for BLO pulses}
\label{app:conv-regs-CH2RPPCR}
\vspace{11pt}
\noindent
......@@ -380,19 +535,19 @@ CH4PCR
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5PCR[31:24]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2RPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5PCR[23:16]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2RPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5PCR[15:8]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2RPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5PCR[7:0]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH2RPPCR[7:0]}\\
\hline
\end{tabular}
}
......@@ -400,16 +555,46 @@ CH4PCR
\begin{itemize}
\item \begin{small}
{\bf
CH5PCR
} [\emph{read/write}]: Pulse counter value
CH2RPPCR
} [\emph{read/write}]: BLO pulse counter value
\end{small}
\end{itemize}
\subsubsection{CH3RPPCR - Channel 3 Pulse Counter Register for BLO pulses}
\label{app:conv-regs-CH3RPPCR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3RPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3RPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3RPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH3RPPCR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
{\bf
CH3RPPCR
} [\emph{read/write}]: BLO pulse counter value
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH6PCR -- Channel 6 Pulse Counter Register}
\label{app:conv-regs-ch6pcr}
\subsubsection{CH4RPPCR - Channel 4 Pulse Counter Register for BLO pulses}
\label{app:conv-regs-CH4RPPCR}
\vspace{11pt}
\noindent
......@@ -417,19 +602,19 @@ CH5PCR
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6PCR[31:24]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4RPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6PCR[23:16]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4RPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6PCR[15:8]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4RPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6PCR[7:0]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4RPPCR[7:0]}\\
\hline
\end{tabular}
}
......@@ -437,16 +622,80 @@ CH5PCR
\begin{itemize}
\item \begin{small}
{\bf
CH6PCR
} [\emph{read/write}]: Pulse counter value
CH4RPPCR
} [\emph{read/write}]: BLO pulse counter value
\end{small}
\end{itemize}
\subsubsection{CH5RPPCR - Channel 5 Pulse Counter Register for BLO pulses}
\label{app:conv-regs-CH5RPPCR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5RPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5RPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5RPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH5RPPCR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
{\bf
CH5RPPCR
} [\emph{read/write}]: BLO pulse counter value
\end{small}
\end{itemize}
\subsubsection{CH6RPPCR - Channel 6 Pulse Counter Register for BLO pulses}
\label{app:conv-regs-CH6RPPCR}
\vspace{11pt}
\subsubsection{TVLR -- Time Value Low Register}
\label{app:conv-regs-tvlr}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6RPPCR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6RPPCR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6RPPCR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH6RPPCR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
{\bf
CH6RPPCR
} [\emph{read/write}]: BLO pulse counter value
\end{small}
\end{itemize}
\subsubsection{TVLR - Time Value Low Register}
\label{app:conv-regs-TVLR}
\vspace{11pt}
\noindent
......@@ -479,13 +728,11 @@ TVLR
\\
Writing this field resets the internal cycles counter.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{TVHR -- Time Value High Register}
\label{app:conv-regs-tvhr}
\subsubsection{TVHR - Time Value High Register}
\label{app:conv-regs-TVHR}
\vspace{11pt}
\noindent
......@@ -518,14 +765,9 @@ TVHR
\\
Writing this field resets the internal cycles counter.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{TBMR -- Tag Buffer Meta Register}
\label{app:conv-regs-tbmr}
\subsubsection{TBMR - Tag Buffer Meta Register}
\label{app:conv-regs-TBMR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -564,16 +806,9 @@ WRTAG
\\
1 - Current time tag generated with White Rabbit \\ 0 - Current time tag generated with internal counter
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\item \begin{small}
\textbf{A read from this register advances the buffer read pointer, if the ring buffer is not empty}
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{TBCYR -- Tag Buffer Cycles Register}
\label{app:conv-regs-tbcyr}
\subsubsection{TBCYR - Tag Buffer Cycles Register}
\label{app:conv-regs-TBCYR}
\vspace{11pt}
\noindent
......@@ -606,13 +841,11 @@ TBCYR
\\
Value of the 8-ns cycles counter when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{TBTLR -- Tag Buffer TAI Low Register}
\label{app:conv-regs-tbtlr}
\subsubsection{TBTLR - Tag Buffer TAI Low Register}
\label{app:conv-regs-TBTLR}
\vspace{11pt}
\noindent
......@@ -645,14 +878,10 @@ TBTLR
\\
Value of the TAI seconds counter bits 31..0 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\pagebreak
\vspace{11pt}
\subsubsection{TBTHR -- Tag Buffer TAI High Register}
\label{app:conv-regs-tbthr}
\subsubsection{TBTHR - Tag Buffer TAI High Register}
\label{app:conv-regs-TBTHR}
\vspace{11pt}
\noindent
......@@ -685,14 +914,9 @@ TBTHR
\\
Value of the TAI seconds counter bits 39..32 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{TBCSR -- Tag Buffer Control and Status Register}
\label{app:conv-regs-tbcsr}
\subsubsection{TBCSR - Tag Buffer Control and Status Register}
\label{app:conv-regs-TBCSR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -745,14 +969,9 @@ CLR
\\
1 -- clear\\ 0 -- no effect
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH1LTSCYR -- Channel 1 Latest Timestamp Cycles Register}
\label{app:conv-regs-ch1ltscyr}
\subsubsection{CH1LTSCYR - Channel 1 Latest Timestamp Cycles Register}
\label{app:conv-regs-CH1LTSCYR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -780,17 +999,14 @@ CLR
\item \begin{small}
{\bf
CH1LTSCYR
} [\emph{write-only}]: Cycles counter
} [\emph{read-only}]: Cycles counter
\\
Value of the 8-ns cycles counter when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH1LTSTLR -- Channel 1 Latest Timestamp TAI Low Register}
\label{app:conv-regs-ch1ltstlr}
\subsubsection{CH1LTSTLR - Channel 1 Latest Timestamp TAI Low Register}
\label{app:conv-regs-CH1LTSTLR}
\vspace{11pt}
\noindent
......@@ -823,15 +1039,10 @@ CH1LTSTLR
\\
Value of the TAI seconds counter bits 31..0 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH1LTSTHR - Channel 1 Latest Timestamp TAI High Register}
\label{app:conv-regs-CH1LTSTHR}
\pagebreak
\subsubsection{CH1LTSTHR -- Channel 1 Latest Timestamp TAI High Register}
\label{app:conv-regs-ch1ltsthr}
\vspace{11pt}
\noindent
......@@ -871,14 +1082,9 @@ WRTAG
\\
1 - Current time tag generated with White Rabbit \\ 0 - Current time tag generated with internal counter
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH2LTSCYR -- Channel 2 Latest Timestamp Cycles Register}
\label{app:conv-regs-ch2ltscyr}
\subsubsection{CH2LTSCYR - Channel 2 Latest Timestamp Cycles Register}
\label{app:conv-regs-CH2LTSCYR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -906,18 +1112,13 @@ WRTAG
\item \begin{small}
{\bf
CH2LTSCYR
} [\emph{write-only}]: Cycles counter
} [\emph{read-only}]: Cycles counter
\\
Value of the 8-ns cycles counter when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH2LTSTLR -- Channel 2 Latest Timestamp TAI Low Register}
\label{app:conv-regs-ch2ltstlr}
\subsubsection{CH2LTSTLR - Channel 2 Latest Timestamp TAI Low Register}
\label{app:conv-regs-CH2LTSTLR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -949,14 +1150,9 @@ CH2LTSTLR
\\
Value of the TAI seconds counter bits 31..0 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH2LTSTHR -- Channel 2 Latest Timestamp TAI High Register}
\label{app:conv-regs-ch2ltsthr}
\subsubsection{CH2LTSTHR - Channel 2 Latest Timestamp TAI High Register}
\label{app:conv-regs-CH2LTSTHR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -995,14 +1191,9 @@ WRTAG
\\
1 - Current time tag generated with White Rabbit \\ 0 - Current time tag generated with internal counter
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH3LTSCYR -- Channel 3 Latest Timestamp Cycles Register}
\label{app:conv-regs-ch3ltscyr}
\subsubsection{CH3LTSCYR - Channel 3 Latest Timestamp Cycles Register}
\label{app:conv-regs-CH3LTSCYR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1030,18 +1221,13 @@ WRTAG
\item \begin{small}
{\bf
CH3LTSCYR
} [\emph{write-only}]: Cycles counter
} [\emph{read-only}]: Cycles counter
\\
Value of the 8-ns cycles counter when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH3LTSTLR -- Channel 3 Latest Timestamp TAI Low Register}
\label{app:conv-regs-ch3ltstlr}
\subsubsection{CH3LTSTLR - Channel 3 Latest Timestamp TAI Low Register}
\label{app:conv-regs-CH3LTSTLR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1073,15 +1259,9 @@ CH3LTSTLR
\\
Value of the TAI seconds counter bits 31..0 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\pagebreak
\subsubsection{CH3LTSTHR -- Channel 3 Latest Timestamp TAI High Register}
\label{app:conv-regs-ch3ltsthr}
\subsubsection{CH3LTSTHR - Channel 3 Latest Timestamp TAI High Register}
\label{app:conv-regs-CH3LTSTHR}
\vspace{11pt}
\noindent
......@@ -1121,33 +1301,28 @@ WRTAG
\\
1 - Current time tag generated with White Rabbit \\ 0 - Current time tag generated with internal counter
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH4LTSCYR -- Channel 4 Latest Timestamp Cycles Register}
\label{app:conv-regs-ch4ltscyr}
\subsubsection{CH4LTSCYR - Channel 4 Latest Timestamp Cycles Register}
\label{app:conv-regs-CH4LTSCYR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & \multicolumn{4}{|c|}{\cellcolor{gray!25}TAI[27:24]}\\
\multicolumn{1}{|c}{-} & - & - & - & \multicolumn{4}{|c|}{\cellcolor{gray!25}CH4LTSCYR[27:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}TAI[23:16]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4LTSCYR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}TAI[15:8]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4LTSCYR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}TAI[7:0]}\\
\multicolumn{8}{|c|}{\cellcolor{gray!25}CH4LTSCYR[7:0]}\\
\hline
\end{tabular}
}
......@@ -1155,19 +1330,14 @@ WRTAG
\begin{itemize}
\item \begin{small}
{\bf
TAI
} [\emph{write-only}]: Cycles counter
CH4LTSCYR
} [\emph{read-only}]: Cycles counter
\\
Value of the 8-ns cycles counter when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH4LTSTLR -- Channel 4 Latest Timestamp TAI Low Register}
\label{app:conv-regs-ch4ltstlr}
\subsubsection{CH4LTSTLR - Channel 4 Latest Timestamp TAI Low Register}
\label{app:conv-regs-CH4LTSTLR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1199,14 +1369,9 @@ CH4LTSTLR
\\
Value of the TAI seconds counter bits 31..0 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH4LTSTHR -- Channel 4 Latest Timestamp TAI High Register}
\label{app:conv-regs-ch4ltsthr}
\subsubsection{CH4LTSTHR - Channel 4 Latest Timestamp TAI High Register}
\label{app:conv-regs-CH4LTSTHR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1245,14 +1410,9 @@ WRTAG
\\
1 - Current time tag generated with White Rabbit \\ 0 - Current time tag generated with internal counter
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH5LTSCYR -- Channel 5 Latest Timestamp Cycles Register}
\label{app:conv-regs-ch5ltscyr}
\subsubsection{CH5LTSCYR - Channel 5 Latest Timestamp Cycles Register}
\label{app:conv-regs-CH5LTSCYR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1280,18 +1440,13 @@ WRTAG
\item \begin{small}
{\bf
CH5LTSCYR
} [\emph{write-only}]: Cycles counter
} [\emph{read-only}]: Cycles counter
\\
Value of the 8-ns cycles counter when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH5LTSTLR -- Channel 5 Latest Timestamp TAI Low Register}
\label{app:conv-regs-ch5ltstlr}
\subsubsection{CH5LTSTLR - Channel 5 Latest Timestamp TAI Low Register}
\label{app:conv-regs-CH5LTSTLR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1323,15 +1478,9 @@ CH5LTSTLR
\\
Value of the TAI seconds counter bits 31..0 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\pagebreak
\subsubsection{CH5LTSTHR -- Channel 5 Latest Timestamp TAI High Register}
\label{app:conv-regs-ch5ltsthr}
\subsubsection{CH5LTSTHR - Channel 5 Latest Timestamp TAI High Register}
\label{app:conv-regs-CH5LTSTHR}
\vspace{11pt}
\noindent
......@@ -1371,14 +1520,9 @@ WRTAG
\\
1 - Current time tag generated with White Rabbit \\ 0 - Current time tag generated with internal counter
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH6LTSCYR -- Channel 6 Latest Timestamp Cycles Register}
\label{app:conv-regs-ch6ltscyr}
\subsubsection{CH6LTSCYR - Channel 6 Latest Timestamp Cycles Register}
\label{app:conv-regs-CH6LTSCYR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1406,17 +1550,13 @@ WRTAG
\item \begin{small}
{\bf
CH6LTSCYR
} [\emph{write-only}]: Cycles counter
} [\emph{read-only}]: Cycles counter
\\
Value of the 8-ns cycles counter when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH6LTSTLR -- Channel 6 Latest Timestamp TAI Low Register}
\label{app:conv-regs-ch6ltstlr}
\subsubsection{CH6LTSTLR - Channel 6 Latest Timestamp TAI Low Register}
\label{app:conv-regs-CH6LTSTLR}
\vspace{11pt}
\noindent
......@@ -1449,14 +1589,9 @@ CH6LTSTLR
\\
Value of the TAI seconds counter bits 31..0 when time tag was taken.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{CH6LTSTHR -- Channel 6 Latest Timestamp TAI High Register}
\label{app:conv-regs-ch6ltsthr}
\subsubsection{CH6LTSTHR - Channel 6 Latest Timestamp TAI High Register}
\label{app:conv-regs-CH6LTSTHR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1495,12 +1630,8 @@ WRTAG
\\
1 - Current time tag generated with White Rabbit \\ 0 - Current time tag generated with internal counter
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{LSR -- Line Status Register}
\subsubsection{LSR - Line Status Register}
\label{app:conv-regs-lsr}
\vspace{11pt}
......@@ -1569,15 +1700,9 @@ REARFS
\\
High if line is in failsafe mode (e.g., no cable plugged in)\\ Bit 0 -- channel 1\\ Bit 1 -- channel 2\\ etc.
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize}
\vspace{11pt}
\subsubsection{OSWR -- Other Switches Register}
\label{app:conv-regs-oswr}
\subsubsection{OSWR - Other Switch Register}
\label{app:conv-regs-OSWR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
......@@ -1609,7 +1734,107 @@ SWITCHES
\\
1 -- switch is ON \\ 0 -- switch is OFF
\end{small}
\end{itemize}
\subsubsection{UIDLR - 32 LS bits of 1-wire thermometer ID}
\label{app:conv-regs-UIDLR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDLR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDLR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDLR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDLR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
{\bf
UIDLR
} [\emph{read-only}]: LS bits of 1-wire DS18B20U thermometer ID
\end{small}
\end{itemize}
\subsubsection{UIDHR - 32 MS bits of 1-wire thermometer ID}
\label{app:conv-regs-UIDHR}
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDHR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDHR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDHR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}UIDHR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
{\bf
UIDHR
} [\emph{read-only}]: MS bits of 1-wire DS18B20U thermometer ID
\end{small}
\end{itemize}
\subsubsection{TEMPR - Temperature Resgister }
\label{app:conv-regs-TEMPR}
Raw temperature data from the one wire DS18B20U. The register is 2-bytes long; it translates to ${}^{o}C$ as follows: Temp = register value / 16.0
\vspace{11pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & - & - & - & \multicolumn{1}{c|}{-}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & - & - & - & \multicolumn{1}{c|}{-}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}TEMPR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{gray!25}TEMPR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
{\bf
TEMPR
} [\emph{read-only}]: TEMP
\\
Current on-board temperature
\end{small}
\end{itemize}
......@@ -268,6 +268,21 @@ OSWR (see Appendix~\ref{app:memmap}), as shown in Figure~\ref{fig:switches}.
\caption{\label{fig:switches} Switch input logic}
\end{figure}
%==============================================================================
% SEC: PCB Version
%==============================================================================
\subsection{PCB Version}
\label{sec:pcb-ver}
CONV-TTL-RS485 boards from version 4 onwards, offer the possibility for the FPGA to receive
information on the hardware version. This information is hardwired on the board in the form of
pulled-up or pulled-down resistors for each of the 6 lines~\cite{conv-ttl-RS485-hwguide}
(4 bits for the PCB version number, and 2 bits for the execution).
The PCB version is stored as 6 bits inside the Status Register of the memory map~\ref{app:memmap} for diagnotics.
Since the hardware version is not available on older boards and since the I/O pins now assigned to it were by default pulled-
down, boards v3 and earlier will show the PCB version as 000000.
%==============================================================================
\pagebreak
\section{Output logic}
......@@ -294,6 +309,8 @@ when it is OFF.
%==============================================================================
\subsection{Pulse LED output logic}
\label{sec:pulse-led}
\textit {Note that this very same logic has been moved inside conv-common-gw submodule
for inverted channels.}\\
Since in the CONV-TTL-RS485 schematics the rear-panel pulse LEDs are driven from inverting
Schmitt triggers to ground, the active-high pulse LED output from \textit{conv\_common\_gw}
......
--==============================================================================
-- CERN (BE-CO-HT)
-- Testbench for CONV-TTL-BLO design
--==============================================================================
--
-- author: Theodor Stana (t.stana@cern.ch)
--
-- date of creation: 2014-02-18
--
-- version: 1.0
--
-- description:
-- Design-wide simulation testbench for the CONV-TTL-BLO gateware. Currently
-- simulated features include:
-- - pulse triggering
-- - I2C master for reading register contents
--
-- dependencies:
-- None.
--
--==============================================================================
-- GNU LESSER GENERAL PUBLIC LICENSE
--==============================================================================
-- This source file is free software; you can redistribute it and/or modify it
-- under the terms of the GNU Lesser General Public License as published by the
-- Free Software Foundation; either version 2.1 of the License, or (at your
-- option) any later version. This source is distributed in the hope that it
-- will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-- See the GNU Lesser General Public License for more details. You should have
-- received a copy of the GNU Lesser General Public License along with this
-- source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
--==============================================================================
-- last changes:
-- 2014-02-18 Theodor Stana File created
--==============================================================================
-- TODO: -
--==============================================================================
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity testbench is
end entity testbench;
architecture behav of testbench is
--============================================================================
-- Type declarations
--============================================================================
type t_state_i2c_mst is
(
IDLE,
I2C_ADDR, I2C_ADDR_ACK,
WB_ADDR_B0, WB_ADDR_B0_ACK,
WB_ADDR_B1, WB_ADDR_B1_ACK,
ST_OP,
RD_RESTART, RD_RESTART_ACK,
RD, RD_ACK,
WR, WR_ACK,
STO,
SUCCESS,
ERR
);
--============================================================================
-- Constant declarations
--============================================================================
-- Clock periods
constant c_clk_20_per : time := 50 ns;
constant c_clk_125_per : time := 8 ns;
-- Number of I2C masters and slaves for the I2C bus model
constant c_nr_masters : positive := 1;
constant c_nr_slaves : positive := 1;
--============================================================================
-- Component declarations
--============================================================================
component conv_ttl_blo is
generic
(
g_nr_ttl_chan : natural := 6;
g_nr_inv_chan : natural := 4;
g_sim : boolean := false
);
port
(
-- Clocks
-- 20 MHz from VCXO
clk_20_vcxo_i : in std_logic;
-- 125 MHz from clock generator
fpga_clk_p_i : in std_logic;
fpga_clk_n_i : in std_logic;
-- LEDs
led_ctrl0_o : out std_logic;
led_ctrl0_oen_o : out std_logic;
led_ctrl1_o : out std_logic;
led_ctrl1_oen_o : out std_logic;
led_multicast_2_0_o : out std_logic;
led_multicast_3_1_o : out std_logic;
led_wr_gmt_ttl_ttln_o : out std_logic;
led_wr_link_syserror_o : out std_logic;
led_wr_ok_syspw_o : out std_logic;
led_wr_ownaddr_i2c_o : out std_logic;
-- I/Os for pulses
pulse_front_led_n_o : out std_logic_vector(g_nr_ttl_chan downto 1);
pulse_rear_led_n_o : out std_logic_vector(g_nr_ttl_chan downto 1);
fpga_input_ttl_n_i : in std_logic_vector(g_nr_ttl_chan downto 1);
fpga_out_ttl_o : out std_logic_vector(g_nr_ttl_chan downto 1);
fpga_blo_in_i : in std_logic_vector(g_nr_ttl_chan downto 1);
fpga_trig_blo_o : out std_logic_vector(g_nr_ttl_chan downto 1);
inv_in_n_i : in std_logic_vector(g_nr_inv_chan downto 1);
inv_out_o : out std_logic_vector(g_nr_inv_chan downto 1);
-- Output enable lines
fpga_oe_o : out std_logic;
fpga_blo_oe_o : out std_logic;
fpga_trig_ttl_oe_o : out std_logic;
fpga_inv_oe_o : out std_logic;
--TTL/INV_TTL_N
ttl_switch_n_i : in std_logic;
extra_switch_n_i : in std_logic_vector(7 downto 1);
-- Lines for the i2c_slave
scl_i : in std_logic;
scl_o : out std_logic;
scl_oe_o : out std_logic;
sda_i : in std_logic;
sda_o : out std_logic;
sda_oe_o : out std_logic;
fpga_ga_i : in std_logic_vector(4 downto 0);
fpga_gap_i : in std_logic;
-- Flash memory lines
fpga_prom_cclk_o : out std_logic;
fpga_prom_cso_b_n_o : out std_logic;
fpga_prom_mosi_o : out std_logic;
fpga_prom_miso_i : in std_logic;
-- Blocking power supply reset line
mr_n_o : out std_logic;
-- Thermometer line
thermometer_b : inout std_logic;
-- PLL DACs
-- DAC1: 20 MHz VCXO control
fpga_plldac1_din_o : out std_logic;
fpga_plldac1_sclk_o : out std_logic;
fpga_plldac1_sync_n_o : out std_logic;
-- DAC2: 125 MHz clock generator control
fpga_plldac2_din_o : out std_logic;
fpga_plldac2_sclk_o : out std_logic;
fpga_plldac2_sync_n_o : out std_logic;
-- SFP lines
fpga_sfp_los_i : in std_logic;
fpga_sfp_mod_def0_i : in std_logic;
fpga_sfp_rate_select_o : out std_logic;
fpga_sfp_mod_def1_b : inout std_logic;
fpga_sfp_mod_def2_b : inout std_logic;
fpga_sfp_tx_disable_o : out std_logic;
fpga_sfp_tx_fault_i : in std_logic;
-- RTM identifiers, should match with the expected values
fpga_rtmm_n_i : in std_logic_vector(2 downto 0);
fpga_rtmp_n_i : in std_logic_vector(2 downto 0)
);
end component conv_ttl_blo;
-- I2C bus model
component i2c_bus_model is
generic
(
g_nr_masters : positive := 1;
g_nr_slaves : positive := 1
);
port
(
-- Input ports from master lines
mscl_i : in std_logic_vector(g_nr_masters-1 downto 0);
msda_i : in std_logic_vector(g_nr_masters-1 downto 0);
-- Input ports from slave lines
sscl_i : in std_logic_vector(g_nr_slaves-1 downto 0);
ssda_i : in std_logic_vector(g_nr_slaves-1 downto 0);
-- SCL and SDA line outputs
scl_o : out std_logic;
sda_o : out std_logic
);
end component i2c_bus_model;
-- I2C master
component i2c_master_byte_ctrl is
port
(
clk : in std_logic;
rst : in std_logic; -- synchronous active high reset (WISHBONE compatible)
nReset : in std_logic; -- asynchornous active low reset (FPGA compatible)
ena : in std_logic; -- core enable signal
clk_cnt : in unsigned(15 downto 0); -- 4x SCL
-- input signals
start,
stop,
read,
write,
ack_in : std_logic;
din : in std_logic_vector(7 downto 0);
-- output signals
cmd_ack : out std_logic; -- command done
ack_out : out std_logic;
i2c_busy : out std_logic; -- arbitration lost
i2c_al : out std_logic; -- i2c bus busy
dout : out std_logic_vector(7 downto 0);
-- i2c lines
scl_i : in std_logic; -- i2c clock line input
scl_o : out std_logic; -- i2c clock line output
scl_oen : out std_logic; -- i2c clock line output enable, active low
sda_i : in std_logic; -- i2c data line input
sda_o : out std_logic; -- i2c data line output
sda_oen : out std_logic -- i2c data line output enable, active low
);
end component i2c_master_byte_ctrl;
--============================================================================
-- Signal declarations
--============================================================================
signal clk_20, clk_125 : std_logic;
signal clk_125_p, clk_125_n : std_logic;
signal rst_n, rst : std_logic;
signal pulse_led_front_n : std_logic_vector(6 downto 1);
signal pulse_led_front : std_logic_vector(6 downto 1);
signal pulse_led_rear_n : std_logic_vector(6 downto 1);
signal pulse_led_rear : std_logic_vector(6 downto 1);
signal ttl_inp_n, ttl_outp : std_logic_vector(6 downto 1);
signal ttl_pulse : std_logic_vector(6 downto 1);
signal inv_pulse : std_logic_vector(6 downto 1);
signal blo_inp, blo_outp : std_logic_vector(6 downto 1);
signal blo_pulse : std_logic_vector(6 downto 1);
signal oe, blo_oe, ttl_oe, inv_oe : std_logic;
signal ttl_switch_n : std_logic;
signal switches_n : std_logic_vector(7 downto 1);
-- I2C signals
signal state_i2c_mst : t_state_i2c_mst;
signal mst_fsm_op : std_logic;
signal mst_fsm_start : std_logic;
signal stim_cnt : unsigned(31 downto 0);
signal cnt : unsigned(2 downto 0);
signal buf_byte_cnt : integer;
signal once : boolean;
signal byte_cnt : unsigned(1 downto 0);
signal rcvd : std_logic_vector(31 downto 0);
signal send : std_logic_vector(31 downto 0);
signal send_val : std_logic_vector(31 downto 0);
signal wrote : std_logic;
signal slv_addr : std_logic_vector(6 downto 0);
signal adr : std_logic_vector(31 downto 0);
signal mst_sta : std_logic;
signal mst_sto : std_logic;
signal mst_rd : std_logic;
signal mst_wr : std_logic;
signal mst_ack : std_logic;
signal mst_dat_in : std_logic_vector(7 downto 0);
signal mst_dat_out : std_logic_vector(7 downto 0);
signal mst_cmd_ack : std_logic;
signal ack_fr_slv : std_logic;
signal mscl, msda : std_logic_vector(c_nr_masters-1 downto 0);
signal sscl, ssda : std_logic_vector(c_nr_slaves-1 downto 0);
signal scl, sda : std_logic;
signal scl_fr_mst : std_logic;
signal scl_en_mst : std_logic;
signal sda_fr_mst : std_logic;
signal sda_en_mst : std_logic;
signal scl_fr_slv : std_logic;
signal scl_en_slv : std_logic;
signal sda_fr_slv : std_logic;
signal sda_en_slv : std_logic;
signal t : boolean;
--==============================================================================
-- architecture begin
--==============================================================================
begin
--============================================================================
-- Generate clock signals
--============================================================================
p_clk_20 : process
begin
clk_20 <= '0';
wait for c_clk_20_per/2;
clk_20 <= '1';
wait for c_clk_20_per/2;
end process;
p_clk_125 : process
begin
clk_125 <= '0';
wait for c_clk_125_per/2;
clk_125 <= '1';
wait for c_clk_125_per/2;
end process;
clk_125_p <= clk_125;
clk_125_n <= not clk_125;
--============================================================================
-- Instantiate the DUT
--============================================================================
cmp_dut : conv_ttl_blo
generic map
(
g_nr_ttl_chan => 6,
g_nr_inv_chan => 4,
g_sim => true
)
port map
(
-- Clocks
-- 20 MHz from VCXO
clk_20_vcxo_i => clk_20,
-- 125 MHz from clock generator
fpga_clk_p_i => clk_125_p,
fpga_clk_n_i => clk_125_n,
-- LEDs
led_ctrl0_o => open,
led_ctrl0_oen_o => open,
led_ctrl1_o => open,
led_ctrl1_oen_o => open,
led_multicast_2_0_o => open,
led_multicast_3_1_o => open,
led_wr_gmt_ttl_ttln_o => open,
led_wr_link_syserror_o => open,
led_wr_ok_syspw_o => open,
led_wr_ownaddr_i2c_o => open,
-- I/Os for pulses
pulse_front_led_n_o => pulse_led_front_n,
pulse_rear_led_n_o => pulse_led_rear_n,
fpga_input_ttl_n_i => ttl_inp_n,
fpga_out_ttl_o => ttl_outp,
fpga_blo_in_i => blo_inp,
fpga_trig_blo_o => blo_outp,
inv_in_n_i => (others => '1'),
inv_out_o => open,
-- Output enable lines
fpga_oe_o => oe,
fpga_blo_oe_o => blo_oe,
fpga_trig_ttl_oe_o => ttl_oe,
fpga_inv_oe_o => inv_oe,
--TTL/INV_TTL_N
ttl_switch_n_i => ttl_switch_n,
extra_switch_n_i => switches_n,
-- Lines for the i2c_slave
scl_i => scl,
scl_o => scl_fr_slv,
scl_oe_o => scl_en_slv,
sda_i => sda,
sda_o => sda_fr_slv,
sda_oe_o => sda_en_slv,
fpga_ga_i => "11110",
fpga_gap_i => '0',
-- Flash memory lines
fpga_prom_cclk_o => open,
fpga_prom_cso_b_n_o => open,
fpga_prom_mosi_o => open,
fpga_prom_miso_i => 'Z',
-- Blocking power supply reset line
mr_n_o => rst_n,
-- Thermometer line
thermometer_b => open,
-- PLL DACs
-- DAC1: 20 MHz VCXO control
fpga_plldac1_din_o => open,
fpga_plldac1_sclk_o => open,
fpga_plldac1_sync_n_o => open,
-- DAC2: 125 MHz clock generator control
fpga_plldac2_din_o => open,
fpga_plldac2_sclk_o => open,
fpga_plldac2_sync_n_o => open,
-- SFP lines
fpga_sfp_los_i => '1',
fpga_sfp_mod_def0_i => '1',
fpga_sfp_rate_select_o => open,
fpga_sfp_mod_def1_b => open,
fpga_sfp_mod_def2_b => open,
fpga_sfp_tx_disable_o => open,
fpga_sfp_tx_fault_i => '1',
-- RTM identifiers, should match with the expected values
fpga_rtmm_n_i => (others => '0'),
fpga_rtmp_n_i => (others => '0')
);
-- Tri-state buffers on the I2C lines
sscl(0) <= scl_fr_slv when (scl_en_slv = '1') else
'1';
ssda(0) <= sda_fr_slv when (sda_en_slv = '1') else
'1';
-- Active-high reset
rst <= not rst_n;
--============================================================================
-- Pulse outputs assignment based on OE signals
--============================================================================
ttl_pulse <= ttl_outp when (oe = '1') and (ttl_oe = '1') else (others => '0');
blo_pulse <= blo_outp when (oe = '1') and (blo_oe = '1') else (others => '0');
inv_pulse <= blo_outp when (oe = '1') and (inv_oe = '1') else (others => '0');
--============================================================================
-- Switches
--============================================================================
-- TTL
ttl_switch_n <= '0';
-- GF
switches_n(1) <= '0';
-- other
switches_n(7 downto 2) <= (others => '1');
--============================================================================
-- Pulse LEDs
--============================================================================
pulse_led_front <= not pulse_led_front_n;
pulse_led_rear <= not pulse_led_rear_n;
--============================================================================
-- Pulse stimuli
--============================================================================
blo_inp(6) <= '0';
ttl_inp_n(5 downto 1) <= (others => '1');
gen_pulse_chain : for i in 6 downto 2 generate
blo_inp(i-1) <= blo_outp(i);
end generate gen_pulse_chain;
p_stim_pulse : process
begin
ttl_inp_n(6) <= '1';
wait until t = true;
while (t = true) loop
wait for 240 us;
ttl_inp_n(6) <= '0';
wait for 500 ns;
ttl_inp_n(6) <= '1';
if ttl_outp(6) /= '1' then
assert false report "ttl_outp not '1'" severity warning;
end if;
if blo_outp(6) /= '1' then
assert false report "blo_outp not '1'" severity warning;
end if;
end loop;
end process p_stim_pulse;
process
begin
t <= true;
wait for 2 ms;
t <= false;
wait for 500 ms;
t <= true;
wait for 10 ms;
t <= false;
wait;
end process;
--============================================================================
-- I2C master
--============================================================================
------------------------------------------------------------------------------
-- First, the component instantiation
------------------------------------------------------------------------------
cmp_master : i2c_master_byte_ctrl
port map
(
clk => clk_20,
rst => rst,
nReset => rst_n,
ena => '1',
clk_cnt => x"0027",
-- input signals
start => mst_sta,
stop => mst_sto,
read => mst_rd,
write => mst_wr,
ack_in => mst_ack,
din => mst_dat_in,
-- output signals
cmd_ack => mst_cmd_ack,
ack_out => ack_fr_slv,
i2c_busy => open,
i2c_al => open,
dout => mst_dat_out,
-- i2c lines
scl_i => scl,
scl_o => scl_fr_mst,
scl_oen => scl_en_mst,
sda_i => sda,
sda_o => sda_fr_mst,
sda_oen => sda_en_mst
);
-- Then, the tri-state_i2c_mst buffers on the line
mscl(0) <= scl_fr_mst when (scl_en_mst = '0') else
'1';
msda(0) <= sda_fr_mst when (sda_en_mst = '0') else
'1';
------------------------------------------------------------------------------
-- Bus model instantiation and connection to master and slaves
------------------------------------------------------------------------------
cmp_i2c_bus : i2c_bus_model
generic map
(
g_nr_masters => c_nr_masters,
g_nr_slaves => c_nr_slaves
)
port map
(
mscl_i => mscl,
msda_i => msda,
sscl_i => sscl,
ssda_i => ssda,
scl_o => scl,
sda_o => sda
);
------------------------------------------------------------------------------
-- This FSM controls the signals to the master component to implement the I2C
-- protocol defined together with ELMA. The FSM is controlled by the
-- stimuli process below
------------------------------------------------------------------------------
p_mst_fsm : process (clk_20) is
begin
if rising_edge(clk_20) then
if (rst_n = '0') then
state_i2c_mst <= IDLE;
mst_sta <= '0';
mst_wr <= '0';
mst_sto <= '0';
mst_rd <= '0';
mst_dat_in <= (others => '0');
mst_ack <= '0';
cnt <= (others => '0');
once <= true;
byte_cnt <= (others => '0');
rcvd <= (others => '0');
send <= (others => '0');
else
case state_i2c_mst is
when IDLE =>
if (mst_fsm_start = '1') then
state_i2c_mst <= I2C_ADDR;
send <= std_logic_vector(send_val);
end if;
when I2C_ADDR =>
mst_sta <= '1';
mst_wr <= '1';
mst_dat_in <= slv_addr & '0';
if (mst_cmd_ack = '1') then
mst_sta <= '0';
mst_wr <= '0';
state_i2c_mst <= I2C_ADDR_ACK;
end if;
when I2C_ADDR_ACK =>
cnt <= cnt + 1;
if (cnt = 7) then
if (ack_fr_slv = '0') then
state_i2c_mst <= WB_ADDR_B0;
else
state_i2c_mst <= ERR;
end if;
end if;
when WB_ADDR_B0 =>
mst_wr <= '1';
mst_dat_in <= adr(15 downto 8);
if (mst_cmd_ack = '1') then
mst_wr <= '0';
state_i2c_mst <= WB_ADDR_B0_ACK;
end if;
when WB_ADDR_B0_ACK =>
cnt <= cnt + 1;
if (cnt = 7) then
if (ack_fr_slv = '0') then
state_i2c_mst <= WB_ADDR_B1;
else
state_i2c_mst <= ERR;
end if;
end if;
when WB_ADDR_B1 =>
mst_wr <= '1';
mst_dat_in <= adr(7 downto 0);
if (mst_cmd_ack = '1') then
mst_wr <= '0';
state_i2c_mst <= WB_ADDR_B1_ACK;
end if;
when WB_ADDR_B1_ACK =>
cnt <= cnt + 1;
if (cnt = 7) then
if (ack_fr_slv = '0') then
state_i2c_mst <= ST_OP;
else
state_i2c_mst <= ERR;
end if;
end if;
when ST_OP =>
if (mst_fsm_op = '1') then
state_i2c_mst <= RD_RESTART;
else
state_i2c_mst <= WR;
end if;
when RD_RESTART =>
mst_wr <= '1';
mst_dat_in <= slv_addr & '1';
mst_sta <= '1';
if (mst_cmd_ack = '1') then
mst_sta <= '0';
mst_wr <= '0';
state_i2c_mst <= RD_RESTART_ACK;
end if;
when RD_RESTART_ACK =>
cnt <= cnt + 1;
if (cnt = 7) then
if (ack_fr_slv = '0') then
state_i2c_mst <= RD;
else
state_i2c_mst <= ERR;
end if;
end if;
when RD =>
mst_rd <= '1';
mst_ack <= '0';
if (byte_cnt = 3) then
mst_ack <= '1';
end if;
if (mst_cmd_ack = '1') then
mst_rd <= '0';
byte_cnt <= byte_cnt + 1;
rcvd <= mst_dat_out & rcvd(31 downto 8);
mst_ack <= '0';
state_i2c_mst <= RD;
if (byte_cnt = 3) then
state_i2c_mst <= STO;
end if;
end if;
when RD_ACK =>
cnt <= cnt + 1;
if (cnt = 7) then
byte_cnt <= byte_cnt + 1;
rcvd <= mst_dat_out & rcvd(31 downto 8);
mst_ack <= '0';
state_i2c_mst <= RD;
if (byte_cnt = 3) then
state_i2c_mst <= STO;
end if;
end if;
when WR =>
mst_wr <= '1';
mst_dat_in <= send(7 downto 0);
if (mst_cmd_ack = '1') then
mst_wr <= '0';
state_i2c_mst <= WR_ACK;
end if;
when WR_ACK =>
cnt <= cnt + 1;
if (cnt = 7) then
if (ack_fr_slv = '0') then
byte_cnt <= byte_cnt + 1;
send <= x"00" & send(31 downto 8);
state_i2c_mst <= WR;
if (byte_cnt = 3) then
state_i2c_mst <= STO;
end if;
else
state_i2c_mst <= ERR;
end if;
end if;
when STO =>
mst_sto <= '1';
if (mst_cmd_ack = '1') then
mst_sto <= '0';
state_i2c_mst <= IDLE;
end if;
when ERR =>
if (once) then
report("Error!");
once <= false;
end if;
when others =>
state_i2c_mst <= ERR;
end case;
end if;
end if;
end process p_mst_fsm;
------------------------------------------------------------------------------
-- Process to "stimulate" the master FSM above
------------------------------------------------------------------------------
p_stim_mst_fsm : process (rst_n, t, state_i2c_mst)
begin
if (rst_n = '0') then
mst_fsm_start <= '0';
mst_fsm_op <= '0';
slv_addr <= "1011110";
adr <= (others => '0');
buf_byte_cnt <= 0;
elsif (not t) and (state_i2c_mst = IDLE) then
mst_fsm_start <= '1';
mst_fsm_op <= '1';
buf_byte_cnt <= buf_byte_cnt + 1;
case buf_byte_cnt is
when 0 =>
adr(11 downto 0) <= x"030";
when 1 =>
adr(11 downto 0) <= x"034";
when 2 =>
adr(11 downto 0) <= x"038";
when 3 =>
adr(11 downto 0) <= x"02c";
buf_byte_cnt <= 0;
when others =>
buf_byte_cnt <= 0;
end case;
else
mst_fsm_start <= '0';
end if;
end process p_stim_mst_fsm;
end architecture behav;
--==============================================================================
-- architecture end
--==============================================================================
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment