\hypertarget{latp_8c}{
\section{latp.c File Reference}
\label{latp_8c}\index{latp.c@{latp.c}}
}
LATp operations.  


{\tt \#include $<$LATC/LATC\_\-msgs.h$>$}\par
{\tt \#include $<$latp\_\-p.h$>$}\par
{\tt \#include $<$data.h$>$}\par
{\tt \#include $<$AG\_\-descriptions\_\-s.h$>$}\par
{\tt \#include $<$AG\_\-lem\_\-s.h$>$}\par
{\tt \#include $<$AG\_\-addr\_\-s.h$>$}\par
{\tt \#include $<$AG\_\-fldEnums\_\-s.h$>$}\par
{\tt \#include $<$AG\_\-regEnums\_\-s.h$>$}\par
{\tt \#include $<$number.ic$>$}\par
{\tt \#include $<$LEM/msg\_\-macros.h$>$}\par
{\tt \#include $<$LEM/list.h$>$}\par
{\tt \#include $<$LEM/decode.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{latp_8c_facd331296c10f360da7640e0d68429f}{
\#define \textbf{NELEM}(x)~(sizeof x / sizeof x\mbox{[}0\mbox{]})}
\label{latp_8c_facd331296c10f360da7640e0d68429f}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static unsigned \hyperlink{latp_8c_d0ffa5858ad4634c46cf86670a269dff}{traverseRead} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, unsigned $\ast$index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned depth, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Traverse the LAT reading the configuration for all nodes. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_50b2d7399834545248d42de05d948018}{traverseLoad} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type, unsigned $\ast$index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned depth)
\begin{CompactList}\small\item\em Traverse the LAT reading the configuration for all nodes. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_74517d51ad1d7011e3ff6dcf41e3a002}{loadReg} (\hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned reg, unsigned short $\ast$ptr)
\begin{CompactList}\small\item\em Load a single register. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_bbb9df9260ebfdb1e2b74a3007b9f436}{readReg} (\hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned reg, void $\ast$dst)
\begin{CompactList}\small\item\em Read a single register. \item\end{CompactList}\item 
static void \hyperlink{latp_8c_463f4bdfb72462bec49861ea0bdc9b55}{handleReadErrors} (unsigned error, unsigned index, void $\ast$ptr)
\begin{CompactList}\small\item\em Read error callback routine for LATC. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_0e11b2341dad9faa2277a0993d5c430a}{loadSimple} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type)
\begin{CompactList}\small\item\em Load a generic LAT component. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_cea501fe40b95c99146a58112c88823f}{loadSplit} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, int nLow, int nHigh)
\begin{CompactList}\small\item\em Load the layer splits. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_0aef449d061697db0f13ff3331ea0919}{loadLayerSplit} (\hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, short low, short high)
\begin{CompactList}\small\item\em Load the splits for a single layer. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_7c133643e3c5c50588d36aae7b87d963}{loadTracker} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type)
\begin{CompactList}\small\item\em Load the tracker front ends from the configuration tree. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_b977ad4193900314f2f2e8fca765e9be}{loadCpt} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type, unsigned index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr)
\begin{CompactList}\small\item\em Set all the registers of the target component. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_507caef611c13c8336f7ddde61737bf2}{readSimple} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current configuration for a register type. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_186abc389ced96dfc498370188ff3110}{readSplit} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current layer splits from the TRC TFE\_\-CNT settings. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_e41e47a87ab326ac94abb5cde819523c}{readTracker} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current TFE settings. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_8d2089038f359f1f1f5b37155d6fd238}{readCpt} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, unsigned index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr)
\begin{CompactList}\small\item\em Read all the registers of the current component. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_f23939924bb4d84e2329214b0da7ddeb}{LATC\_\-read} (LATC\_\-imm $\ast$imm, LEM\_\-micr $\ast$cr, \hyperlink{structLATC__di}{LATC\_\-di} $\ast$di, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current configuration of the LAT. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_ee8d896636d998b3bad9ab2086212c12}{LATC\_\-load} (LATC\_\-imm $\ast$imm, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load the LAT with the configuration held in {\em imm\/}. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_8b4f14b2930a19a260164889d8758b3a}{loadAfeConfig} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value0, unsigned int value1, unsigned int rcMask, unsigned int feMask, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load the AFE configuration register. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_e4f9b63e4a8bacc943854e09a78c270d}{loadCfeConfig0} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load CFE configuration register 0. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_609ea55eac01e88d632a30dd43227bf2}{loadCfeConfig1} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value0, unsigned int value1, unsigned int cMask, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load CFE configuration register 1. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_e1818323d7049e121c25a350916910d0}{loadTkrSplits} (LATC\_\-imm $\ast$imm, int nLow, int nHigh, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load TKR splits values. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_eb5f17cf2bc208728b29fa1bd2c9e7cd}{loadTfeDac} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value, int nLow, int nHigh, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load the TFE DAC register. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_5fe6b3c074c3481ade2d6e06abdbc47e}{setTrigger} (LATC\_\-imm $\ast$imm, int enable, int marker, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Enable or disable triggers. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
LATp operations. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\hyperlink{latp_8c}{latp.c},v 1.41 2011/04/08 00:20:45 apw Exp \end{Desc}


\subsection{Function Documentation}
\hypertarget{latp_8c_463f4bdfb72462bec49861ea0bdc9b55}{
\index{latp.c@{latp.c}!handleReadErrors@{handleReadErrors}}
\index{handleReadErrors@{handleReadErrors}!latp.c@{latp.c}}
\subsubsection[{handleReadErrors}]{\setlength{\rightskip}{0pt plus 5cm}void handleReadErrors (unsigned {\em error}, \/  unsigned {\em index}, \/  void $\ast$ {\em ptr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_463f4bdfb72462bec49861ea0bdc9b55}


Read error callback routine for LATC. 

This routine clears the bit in the LATC\_\-map corresponding to the register that failed to read

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em error}]Error field from a result item\item[{\em index}]Index of the command the failed\item[{\em ptr}]Pointer to the array of \hyperlink{structLATC__di}{LATC\_\-di} \end{description}
\end{Desc}


References clearBit().

Referenced by LATC\_\-read().\hypertarget{latp_8c_ee8d896636d998b3bad9ab2086212c12}{
\index{latp.c@{latp.c}!LATC\_\-load@{LATC\_\-load}}
\index{LATC\_\-load@{LATC\_\-load}!latp.c@{latp.c}}
\subsubsection[{LATC\_\-load}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-load (LATC\_\-imm $\ast$ {\em imm}, \/  LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_ee8d896636d998b3bad9ab2086212c12}


Load the LAT with the configuration held in {\em imm\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]The IMM structure to use as the basis for the load commands sent to the LAT\item[{\em cr}]Pointer to structure holding multi-item command and response lists (plus some state information)\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References LEM\_\-load::cr, LEM\_\-load::ldfn, loadSimple(), loadSplit(), and loadTracker().

Referenced by LATC\_\-configure().\hypertarget{latp_8c_f23939924bb4d84e2329214b0da7ddeb}{
\index{latp.c@{latp.c}!LATC\_\-read@{LATC\_\-read}}
\index{LATC\_\-read@{LATC\_\-read}!latp.c@{latp.c}}
\subsubsection[{LATC\_\-read}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-read (LATC\_\-imm $\ast$ {\em imm}, \/  LEM\_\-micr $\ast$ {\em cr}, \/  {\bf LATC\_\-di} $\ast$ {\em di}, \/  const LATC\_\-map $\ast$ {\em ign})}}
\label{latp_8c_f23939924bb4d84e2329214b0da7ddeb}


Read the current configuration of the LAT. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the IMM structure to populate from the LAT\item[{\em cr}]Pointer to structure holding multi-item command and response lists (plus some state information)\item[{\em di}]Array of lem\_\-max\_\-ci latc\_\-di objects that capture read errors from the corresponding command items\item[{\em ign}]Map of the sections of the lat known to be bad or not present so can be ignored.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds. \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the c/r list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM. \end{itemize}
\end{description}
\end{Desc}


References LEM\_\-read::cr, LEM\_\-read::ddfn, LEM\_\-read::di, handleReadErrors(), LEM\_\-read::rdfn, readSimple(), readSplit(), and readTracker().

Referenced by LATC\_\-capture().\hypertarget{latp_8c_8b4f14b2930a19a260164889d8758b3a}{
\index{latp.c@{latp.c}!loadAfeConfig@{loadAfeConfig}}
\index{loadAfeConfig@{loadAfeConfig}!latp.c@{latp.c}}
\subsubsection[{loadAfeConfig}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadAfeConfig (LATC\_\-imm $\ast$ {\em imm}, \/  unsigned int {\em mask}, \/  unsigned int {\em value0}, \/  unsigned int {\em value1}, \/  unsigned int {\em rcMask}, \/  unsigned int {\em feMask}, \/  LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_8b4f14b2930a19a260164889d8758b3a}


Load the AFE configuration register. 

The AFE configuration register is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value0}]The value to be masked and merged with the configuration value for front-ends not selected by the RC and FE masks.\item[{\em value1}]The value to be masked and merged with the configuration value for front-ends selected by the RC and FE masks.\item[{\em rcMask}]Mask of bits, one per RC, specifying which RCs are selected.\item[{\em feMask}]Mask of bits, one per FE, specifying which FEs within selected RCs are selected.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands \end{description}
\end{Desc}


References LATC\_\-addr::acd, checkBit(), LEM\_\-load::cr, ACD\_\-addr::fe, LEM\_\-load::ldfn, loadReg(), and ACD\_\-addr::rc.

Referenced by LATC\_\-loadAfeConfig().\hypertarget{latp_8c_e4f9b63e4a8bacc943854e09a78c270d}{
\index{latp.c@{latp.c}!loadCfeConfig0@{loadCfeConfig0}}
\index{loadCfeConfig0@{loadCfeConfig0}!latp.c@{latp.c}}
\subsubsection[{loadCfeConfig0}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadCfeConfig0 (LATC\_\-imm $\ast$ {\em imm}, \/  unsigned int {\em mask}, \/  unsigned int {\em value}, \/  LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_e4f9b63e4a8bacc943854e09a78c270d}


Load CFE configuration register 0. 

CFE configuration register 0 is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value}]The value to be masked and merged with the configuration value.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands \end{description}
\end{Desc}


References TEM\_\-addr::cc, checkBit(), LEM\_\-load::cr, TEM\_\-addr::fe, LEM\_\-load::ldfn, loadReg(), TEM\_\-addr::rc, LATC\_\-addr::tem, and TEM\_\-addr::to.

Referenced by LATC\_\-loadCfeConfig0().\hypertarget{latp_8c_609ea55eac01e88d632a30dd43227bf2}{
\index{latp.c@{latp.c}!loadCfeConfig1@{loadCfeConfig1}}
\index{loadCfeConfig1@{loadCfeConfig1}!latp.c@{latp.c}}
\subsubsection[{loadCfeConfig1}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadCfeConfig1 (LATC\_\-imm $\ast$ {\em imm}, \/  unsigned int {\em mask}, \/  unsigned int {\em value0}, \/  unsigned int {\em value1}, \/  unsigned int {\em cMask}, \/  LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_609ea55eac01e88d632a30dd43227bf2}


Load CFE configuration register 1. 

CFE configuration register 1 is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value0}]The value to be masked and merged with the configuration value for front-ends whose bit is clear in the column mask.\item[{\em value1}]The value to be masked and merged with the configuration value for front-ends whose bit is set in the column mask.\item[{\em cMask}]Mask of bits, one per column, specifying which value is to be used for loading the config register.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands \end{description}
\end{Desc}


References TEM\_\-addr::cc, checkBit(), LEM\_\-load::cr, TEM\_\-addr::fe, LEM\_\-load::ldfn, loadReg(), TEM\_\-addr::rc, LATC\_\-addr::tem, and TEM\_\-addr::to.

Referenced by LATC\_\-loadCfeConfig1().\hypertarget{latp_8c_b977ad4193900314f2f2e8fca765e9be}{
\index{latp.c@{latp.c}!loadCpt@{loadCpt}}
\index{loadCpt@{loadCpt}!latp.c@{latp.c}}
\subsubsection[{loadCpt}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadCpt (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-load} $\ast$ {\em lem\_\-l}, \/  LATC\_\-type {\em type}, \/  unsigned {\em index}, \/  {\bf LATC\_\-addr} $\ast$ {\em addr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_b977ad4193900314f2f2e8fca765e9be}


Set all the registers of the target component. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command/response lists to use for loading the LAT\item[{\em type}]Component type\item[{\em index}]Componenet instance being loaded\item[{\em addr}]Hierarchical representation of the index (address of the instance)\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References checkBit(), loadReg(), CptDescription::nregs, CptDescription::rd, RegDescription::regId, and CptDescription::width.

Referenced by loadSimple(), loadTracker(), and traverseLoad().\hypertarget{latp_8c_0aef449d061697db0f13ff3331ea0919}{
\index{latp.c@{latp.c}!loadLayerSplit@{loadLayerSplit}}
\index{loadLayerSplit@{loadLayerSplit}!latp.c@{latp.c}}
\subsubsection[{loadLayerSplit}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadLayerSplit ({\bf LEM\_\-load} $\ast$ {\em lem\_\-l}, \/  {\bf LATC\_\-addr} $\ast$ {\em addr}, \/  short {\em low}, \/  short {\em high})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_0aef449d061697db0f13ff3331ea0919}


Load the splits for a single layer. 

This routine loads the mode registers on all the TFEs in the layer and sets the split values in the CSRs of the two TRCs in the layer.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lem\_\-l}]Pointer to the command and response lists used for loading the LAT\item[{\em addr}]Pointer to an address structure used for loading the TFEs and TRC\item[{\em low}]ID of the highest low talking TFE\item[{\em high}]ID of the lowest high talking TFE\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References TEM\_\-addr::fe, LATC\_\-addr::layer, LEM\_\-load::ldfn, loadReg(), and LATC\_\-addr::tem.

Referenced by loadSplit().\hypertarget{latp_8c_74517d51ad1d7011e3ff6dcf41e3a002}{
\index{latp.c@{latp.c}!loadReg@{loadReg}}
\index{loadReg@{loadReg}!latp.c@{latp.c}}
\subsubsection[{loadReg}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadReg ({\bf LEM\_\-load} $\ast$ {\em lem\_\-l}, \/  {\bf LATC\_\-addr} $\ast$ {\em addr}, \/  unsigned {\em reg}, \/  unsigned short $\ast$ {\em ptr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_74517d51ad1d7011e3ff6dcf41e3a002}


Load a single register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lem\_\-l}]Pointer to the command/response lists to use for register loads\item[{\em addr}]Pointer to a \hyperlink{unionLATC__addr}{LATC\_\-addr} address structure\item[{\em reg}]Register index\item[{\em ptr}]Pointer to data to be loaded\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References LEM\_\-load::cr, and LEM\_\-load::ldfn.

Referenced by loadAfeConfig(), loadCfeConfig0(), loadCfeConfig1(), loadCpt(), loadLayerSplit(), and loadTfeDac().\hypertarget{latp_8c_0e11b2341dad9faa2277a0993d5c430a}{
\index{latp.c@{latp.c}!loadSimple@{loadSimple}}
\index{loadSimple@{loadSimple}!latp.c@{latp.c}}
\subsubsection[{loadSimple}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadSimple (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-load} $\ast$ {\em lem\_\-l}, \/  LATC\_\-type {\em type})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_0e11b2341dad9faa2277a0993d5c430a}


Load a generic LAT component. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to command and response lists used for loading the LAT\item[{\em type}]Type of LAT component to load\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References LATC\_\-addr::cpt, loadCpt(), and traverseLoad().

Referenced by LATC\_\-load().\hypertarget{latp_8c_cea501fe40b95c99146a58112c88823f}{
\index{latp.c@{latp.c}!loadSplit@{loadSplit}}
\index{loadSplit@{loadSplit}!latp.c@{latp.c}}
\subsubsection[{loadSplit}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadSplit (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-load} $\ast$ {\em lem\_\-l}, \/  int {\em nLow}, \/  int {\em nHigh})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_cea501fe40b95c99146a58112c88823f}


Load the layer splits. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command response lists used for loading the LAT\item[{\em nLow}]Number of TFEs to talk on the low side, or -1 if the configured values are to be used.\item[{\em nHigh}]Number of TFEs to talk on the high side, or -1 if the configured values are to be used.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References checkBit(), Layer\_\-addr::la, LATC\_\-addr::layer, loadLayerSplit(), and Layer\_\-addr::to.

Referenced by LATC\_\-load(), and loadTkrSplits().\hypertarget{latp_8c_eb5f17cf2bc208728b29fa1bd2c9e7cd}{
\index{latp.c@{latp.c}!loadTfeDac@{loadTfeDac}}
\index{loadTfeDac@{loadTfeDac}!latp.c@{latp.c}}
\subsubsection[{loadTfeDac}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadTfeDac (LATC\_\-imm $\ast$ {\em imm}, \/  unsigned int {\em mask}, \/  unsigned int {\em value}, \/  int {\em nLow}, \/  int {\em nHigh}, \/  LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_eb5f17cf2bc208728b29fa1bd2c9e7cd}


Load the TFE DAC register. 

The TFE DAC register is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value}]The value to be masked and merged with the configuration value.\item[{\em nLow}]Number of TFEs talking on the low side, or -1 if the configured values are being used.\item[{\em nHigh}]Number of TFEs talking on the high side, or -1 if the configured values are being used.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands \end{description}
\end{Desc}


References checkBit(), LEM\_\-load::cr, Layer\_\-addr::fe, Layer\_\-addr::la, LATC\_\-addr::layer, LEM\_\-load::ldfn, loadReg(), LATC\_\-addr::tem, and Layer\_\-addr::to.

Referenced by LATC\_\-loadTfeDac().\hypertarget{latp_8c_e1818323d7049e121c25a350916910d0}{
\index{latp.c@{latp.c}!loadTkrSplits@{loadTkrSplits}}
\index{loadTkrSplits@{loadTkrSplits}!latp.c@{latp.c}}
\subsubsection[{loadTkrSplits}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadTkrSplits (LATC\_\-imm $\ast$ {\em imm}, \/  int {\em nLow}, \/  int {\em nHigh}, \/  LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_e1818323d7049e121c25a350916910d0}


Load TKR splits values. 

The tracker RC and FE registers are loaded to reflect the given split values.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em nLow}]Number of TFEs to talk on the low side, or -1 if the configured values are to be used.\item[{\em nHigh}]Number of TFEs to talk on the high side, or -1 if the configured values are to be used.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands \end{description}
\end{Desc}


References LEM\_\-load::cr, LEM\_\-load::ldfn, and loadSplit().

Referenced by LATC\_\-loadTkrSplits().\hypertarget{latp_8c_7c133643e3c5c50588d36aae7b87d963}{
\index{latp.c@{latp.c}!loadTracker@{loadTracker}}
\index{loadTracker@{loadTracker}!latp.c@{latp.c}}
\subsubsection[{loadTracker}]{\setlength{\rightskip}{0pt plus 5cm}unsigned loadTracker (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-load} $\ast$ {\em lem\_\-l}, \/  LATC\_\-type {\em type})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_7c133643e3c5c50588d36aae7b87d963}


Load the tracker front ends from the configuration tree. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command/response lists used for loading the LAT\item[{\em type}]Type of component being loaded, either TFE or TDC\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References checkBit(), Layer\_\-addr::fe, Layer\_\-addr::la, LATC\_\-addr::layer, loadCpt(), LATC\_\-addr::tem, and Layer\_\-addr::to.

Referenced by LATC\_\-load().\hypertarget{latp_8c_8d2089038f359f1f1f5b37155d6fd238}{
\index{latp.c@{latp.c}!readCpt@{readCpt}}
\index{readCpt@{readCpt}!latp.c@{latp.c}}
\subsubsection[{readCpt}]{\setlength{\rightskip}{0pt plus 5cm}unsigned readCpt (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-read} $\ast$ {\em lem\_\-r}, \/  LATC\_\-type {\em type}, \/  unsigned {\em index}, \/  {\bf LATC\_\-addr} $\ast$ {\em addr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_8d2089038f359f1f1f5b37155d6fd238}


Read all the registers of the current component. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Command/response lists to use for the read\item[{\em type}]Cpt type being read\item[{\em index}]Instance of the component being read\item[{\em addr}]Hierarchical representation of the index (address of the instance to read).\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM. \end{itemize}
\end{description}
\end{Desc}


References LEM\_\-read::cr, LEM\_\-read::di, LATC\_\-di::index, LATC\_\-di::map, CptDescription::nregs, CptDescription::rd, readReg(), RegDescription::regId, setBit(), LATC\_\-di::type, and CptDescription::width.

Referenced by readSimple(), readTracker(), and traverseRead().\hypertarget{latp_8c_bbb9df9260ebfdb1e2b74a3007b9f436}{
\index{latp.c@{latp.c}!readReg@{readReg}}
\index{readReg@{readReg}!latp.c@{latp.c}}
\subsubsection[{readReg}]{\setlength{\rightskip}{0pt plus 5cm}unsigned readReg ({\bf LEM\_\-read} $\ast$ {\em lem\_\-r}, \/  {\bf LATC\_\-addr} $\ast$ {\em addr}, \/  unsigned {\em reg}, \/  void $\ast$ {\em dst})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_bbb9df9260ebfdb1e2b74a3007b9f436}


Read a single register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lem\_\-r}]Pointer to command/response lists for reading the LAT registers\item[{\em addr}]Hierarchical identification of the instance to read\item[{\em reg}]Identification of the register to read\item[{\em dst}]Location to place value read from register\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM. \end{itemize}
\end{description}
\end{Desc}


References LEM\_\-read::cr, LEM\_\-read::ddfn, and LEM\_\-read::rdfn.

Referenced by readCpt(), and readSplit().\hypertarget{latp_8c_507caef611c13c8336f7ddde61737bf2}{
\index{latp.c@{latp.c}!readSimple@{readSimple}}
\index{readSimple@{readSimple}!latp.c@{latp.c}}
\subsubsection[{readSimple}]{\setlength{\rightskip}{0pt plus 5cm}unsigned readSimple (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-read} $\ast$ {\em lem\_\-r}, \/  LATC\_\-type {\em type}, \/  const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_507caef611c13c8336f7ddde61737bf2}


Read the current configuration for a register type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure being populated by the read operation\item[{\em lem\_\-r}]Pointer to the command/response lists and other structures used to read the LAT\item[{\em type}]Component type to read\item[{\em ign}]Map of the sections of the LAT known to be bad or not present so can be ignored.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM \end{itemize}
\end{description}
\end{Desc}


References readCpt(), and traverseRead().

Referenced by LATC\_\-read().\hypertarget{latp_8c_186abc389ced96dfc498370188ff3110}{
\index{latp.c@{latp.c}!readSplit@{readSplit}}
\index{readSplit@{readSplit}!latp.c@{latp.c}}
\subsubsection[{readSplit}]{\setlength{\rightskip}{0pt plus 5cm}unsigned readSplit (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-read} $\ast$ {\em lem\_\-r}, \/  const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_186abc389ced96dfc498370188ff3110}


Read the current layer splits from the TRC TFE\_\-CNT settings. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Pointer to the command response lists\item[{\em ign}]Map of the sections of the LAT known to be bad or not present so can be ignored.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM. \end{itemize}
\end{description}
\end{Desc}


References checkBit(), LEM\_\-read::cr, LEM\_\-read::di, LATC\_\-di::index, Layer\_\-addr::la, LATC\_\-addr::layer, LATC\_\-di::map, readReg(), setBit(), LATC\_\-addr::tem, Layer\_\-addr::to, and LATC\_\-di::type.

Referenced by LATC\_\-read().\hypertarget{latp_8c_e41e47a87ab326ac94abb5cde819523c}{
\index{latp.c@{latp.c}!readTracker@{readTracker}}
\index{readTracker@{readTracker}!latp.c@{latp.c}}
\subsubsection[{readTracker}]{\setlength{\rightskip}{0pt plus 5cm}unsigned readTracker (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-read} $\ast$ {\em lem\_\-r}, \/  LATC\_\-type {\em type}, \/  const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_e41e47a87ab326ac94abb5cde819523c}


Read the current TFE settings. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Pointer to the command/response lists used for reading the LAT\item[{\em type}]Component type being read (either TFE or TDC)\item[{\em ign}]Map of the sections of the LAT known to be bad or not present so can be ignored.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM. \end{itemize}
\end{description}
\end{Desc}


References checkBit(), Layer\_\-addr::fe, Layer\_\-addr::la, LATC\_\-addr::layer, readCpt(), LATC\_\-addr::tem, and Layer\_\-addr::to.

Referenced by LATC\_\-read().\hypertarget{latp_8c_5fe6b3c074c3481ade2d6e06abdbc47e}{
\index{latp.c@{latp.c}!setTrigger@{setTrigger}}
\index{setTrigger@{setTrigger}!latp.c@{latp.c}}
\subsubsection[{setTrigger}]{\setlength{\rightskip}{0pt plus 5cm}unsigned setTrigger (LATC\_\-imm $\ast$ {\em imm}, \/  int {\em enable}, \/  int {\em marker}, \/  LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_5fe6b3c074c3481ade2d6e06abdbc47e}


Enable or disable triggers. 

This routine enables or disables LAT triggers. If the marker parameter is non-zero, the LAT is first configured to broadcast a trigger message to all CPUs upon receipt of a solicited trigger, a solicited trigger is issued, and the configuration restored from the IMM data.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing LAT configuration data\item[{\em enable}]If non-zero, triggers are anabled; otherwise disabled\item[{\em marker}]If non-zero, causes a solicited trigger with this value in the event data.\item[{\em cr}]Pointer to the multi-item command/response list.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands \end{description}
\end{Desc}


Referenced by LATC\_\-disableTriggers(), and LATC\_\-enableTriggers().\hypertarget{latp_8c_50b2d7399834545248d42de05d948018}{
\index{latp.c@{latp.c}!traverseLoad@{traverseLoad}}
\index{traverseLoad@{traverseLoad}!latp.c@{latp.c}}
\subsubsection[{traverseLoad}]{\setlength{\rightskip}{0pt plus 5cm}unsigned traverseLoad (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-load} $\ast$ {\em lem\_\-l}, \/  LATC\_\-type {\em type}, \/  unsigned $\ast$ {\em index}, \/  {\bf LATC\_\-addr} $\ast$ {\em addr}, \/  unsigned {\em depth})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_50b2d7399834545248d42de05d948018}


Traverse the LAT reading the configuration for all nodes. 

This routine loads the configuration for any instances of the current component whose configuration differs from the default

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command response lists used for loading the LAT\item[{\em type}]Type of component to load\item[{\em index}]Pointer to the index of the next instance to load\item[{\em addr}]Hierarchical representation of the index\item[{\em depth}]Number of recursive calls to traverse\_\-Load\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands \end{description}
\end{Desc}


References LATC\_\-addr::cpt, and loadCpt().

Referenced by loadSimple().\hypertarget{latp_8c_d0ffa5858ad4634c46cf86670a269dff}{
\index{latp.c@{latp.c}!traverseRead@{traverseRead}}
\index{traverseRead@{traverseRead}!latp.c@{latp.c}}
\subsubsection[{traverseRead}]{\setlength{\rightskip}{0pt plus 5cm}unsigned traverseRead (LATC\_\-imm $\ast$ {\em imm}, \/  {\bf LEM\_\-read} $\ast$ {\em lem\_\-r}, \/  LATC\_\-type {\em type}, \/  unsigned $\ast$ {\em index}, \/  {\bf LATC\_\-addr} $\ast$ {\em addr}, \/  unsigned {\em depth}, \/  const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_d0ffa5858ad4634c46cf86670a269dff}


Traverse the LAT reading the configuration for all nodes. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Pointer to the command/response lists used for reading the LAT\item[{\em type}]The type of component to read\item[{\em index}]Pointer to a variable tracking the current instance being read\item[{\em addr}]Pointer to an address structure containing the same information as index, but in heirarchical form\item[{\em depth}]Number of times this function has been recursively called.\item[{\em ign}]Map of the sections of the LAT known to be bad or not present so can be ignored.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM. \end{itemize}
\end{description}
\end{Desc}


References checkBit(), LATC\_\-addr::cpt, and readCpt().

Referenced by readSimple().