\chapter{DUT Signals}\label{ch:DUTsignals}

In the older, EUDET, version of the \gls{tlu} the direction of the signals on the \verb|HDMI*| connectors were pre-defined. The new hardware has the ability to switch each \gls{lvds} pair between input and output.\\
The function and direction of each \gls{lvds} pair depends on the interface mode chosen.\\
Section~\ref{sec:InterfaceModes} describes the different interface modes in more detail. See chapter~\ref{ch:hwDUT} for  details of how \gls{lvds} pairs are mapped onto physical \gls{hdmi} pins.

%separate lines for signals going into the \gls{tlu} and signals out of the \gls{tlu}. See section~\ref{ch:hw\gls{dut}} for further details. \\

\section{Interface Modes}\label{sec:InterfaceModes}

When operating within the AIDA2020 scope, the \gls{tlu} can be operated in one of four different handshake modes, described in the remaining of this chapter.

\subsection{Trigger/Busy (EUDET) Mode}
This mode is designed to allow the \gls{tlu} and \gls{dut} clocks to be asynchronous and to have any frequency relationship.\\
After the \gls{tlu} detects an input trigger, the TRIGGER signal to the \gls{dut} is asserted and the \gls{tlu} vetoes further triggers.\\
The \gls{dut} responds by asserting the BUSY line to the \gls{tlu}.
The \gls{tlu} detects that the BUSY line has been asserted and responds by de-asserting the trigger line.
Finally the \gls{dut} responds by de-asserting the BUSY line.\\
When the \gls{tlu} detects that the BUSY has been de-asserted it re-enables triggers.\\
Figure \ref{fig:eudet-trigger-busy} shows signal timing for this interface mode.
\begin{figure}[h]
	\centering
	\includegraphics[width=0.99\linewidth]{./Images/aida-tlu-eudet-trigger-busy_01.pdf}
	\caption{Trigger/Busy Interface Mode Timing}
	\label{fig:eudet-trigger-busy}
\end{figure}

\subsection{Trigger/Busy Handshake With Trigger Number}
This interface mode is an extension of the Trigger/Busy handshake.\\
After the \gls{dut} detects that the \gls{tlu} has de-asserted the TRIGGER line it can cause the  \gls{tlu} to clock out the current trigger number by toggling the \gls{dut} clock line. The number is clocked \gls{lsb} first.\\
Figure~\ref{fig:eudet-trigger-busy-trignumber} shows the signal timing for this interface mode.
\begin{figure}[h]
	\centering
	\includegraphics[width=0.99\linewidth]{./Images/aida-tlu-eudet-trigger-busy_trignumber_01.pdf}
	\caption{Trigger/Busy Interface Mode With Trigger Number }
	\label{fig:eudet-trigger-busy-trignumber}
\end{figure}\\
This mode of operations is enabled by setting the DUTMaskMode flag for the specific \gls{dut} to 0b00. See section~\ref{ch:configFile} for details.

\subsection{Synchronous (AIDA) Mode}
In synchronous mode (also known as AIDA mode) the \gls{tlu} sends a clock (by default 40MHz) to the \gls{dut}.\\
When the \gls{tlu} produces a trigger, the trigger line from \gls{tlu} to \gls{dut} is asserted for one cycle of the clock. In order to synchronize time-stamps between \gls{tlu} to \gls{dut} a single cycle timestamp reset signal is issued at the start of each run.\\
The \gls{dut} can veto triggers at any point by asserting the BUSY line.\\
Figure~\ref{fig:aida-handshake} shows the signal timing for this interface mode.
\begin{figure}[h]
	\centering
	\includegraphics[width=0.99\linewidth]{./Images/aida-tlu-aida-interface_01.pdf}
	\caption{Synchronous (AIDA) Interface Mode }
	\label{fig:aida-handshake}
\end{figure}\\
This mode of operations is enabled by setting the DUTMaskMode flag for the specific \gls{dut} to 0b11. See section~\ref{ch:configFile} for details.

\subsection{Synchronous Mode With Trigger Number}
This is a modification of the synchronous/AIDA mode.\\
Immediately after the \gls{tlu} issues a trigger, it clocks out the trigger number (\gls{lsb} first) on the Sync/T0 line.\\
Figure~\ref{fig:aida-handshake-with-trigger} shows the signal timing for this interface mode.
\begin{figure}[h]
	\centering
	\includegraphics[width=0.99\linewidth]{./Images/aida-tlu-aida-with-trigger-timing_01.pdf}
	\caption{Synchronous (AIDA) Interface Mode With Trigger Number }
	\label{fig:aida-handshake-with-trigger}
\end{figure}\\
This mode of operations is enabled by setting the DUTMaskMode flag for the specific \gls{dut} to 0b01. See section~\ref{ch:configFile} for details.