\hypertarget{lrd_8h}{
\section{lrd.h File Reference}
\label{lrd_8h}\index{lrd.h@{lrd.h}}
}
Interface to the LAT register description helper functions. 

{\tt \#include \char`\"{}RIM/structs.h\char`\"{}}\par


Include dependency graph for lrd.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=99pt]{lrd_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=253pt]{lrd_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{lrd_8h_a0}{
typedef unsigned \hyperlink{lrd_8h_a0}{RIM\_\-type}}
\label{lrd_8h_a0}

\begin{CompactList}\small\item\em Creates a new type used to identify components (TEM, TFE etc). \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \{ {\bf RIM\_\-BAD\_\-TYPE} =  -1
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned \hyperlink{lrd_8h_a2}{RIM\_\-n\-Types} (void)
\begin{CompactList}\small\item\em Return the number of component types within the LAT register description. \item\end{CompactList}\item 
\hyperlink{lrd_8h_a0}{RIM\_\-type} \hyperlink{lrd_8h_a3}{RIM\_\-lookup\-Type} (const char $\ast$string)
\begin{CompactList}\small\item\em Hunt through the list of component types and return the index of the input string. \item\end{CompactList}\item 
unsigned \hyperlink{lrd_8h_a4}{RIM\_\-name\-Type} (char $\ast$string, \hyperlink{lrd_8h_a0}{RIM\_\-type} type)
\begin{CompactList}\small\item\em Place the four character string describing this type into {\em name\/}. \item\end{CompactList}\item 
int \hyperlink{lrd_8h_a5}{RIM\_\-compare\-Type} (const char $\ast$string, \hyperlink{lrd_8h_a0}{RIM\_\-type} type)
\begin{CompactList}\small\item\em Compare {\em string\/} with the name of {\em type\/}. \item\end{CompactList}\item 
unsigned \hyperlink{lrd_8h_a6}{RIM\_\-get\-Addr\-Rng} (const char $\ast$string, \hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$addr)
\begin{CompactList}\small\item\em Finds the address range associated with the type identifed by the string. \item\end{CompactList}\item 
unsigned \hyperlink{lrd_8h_a7}{RIM\_\-get\-Layer\-ID} (char sign, char xy, char index, unsigned $\ast$layer)
\begin{CompactList}\small\item\em Take three characters and convert them to a layer ID. \item\end{CompactList}\item 
unsigned \hyperlink{lrd_8h_a8}{RIM\_\-get\-Layer\-Name} (unsigned layer, char $\ast$sign, char $\ast$xy, char $\ast$index)
\begin{CompactList}\small\item\em Get the characters of the layer name from the layer ID. \item\end{CompactList}\item 
unsigned \hyperlink{lrd_8h_a9}{RIM\_\-get\-Address} (\hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$addr, unsigned index, \hyperlink{lrd_8h_a0}{RIM\_\-type} type)
\begin{CompactList}\small\item\em Convert hierarchical bit addressing to flat addressing. \item\end{CompactList}\item 
unsigned \hyperlink{lrd_8h_a10}{RIM\_\-get\-Index} (const \hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$addr, unsigned $\ast$index, \hyperlink{lrd_8h_a0}{RIM\_\-type} type)
\begin{CompactList}\small\item\em Convert hierarchical bit addressing to flat addressing. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface to the LAT register description helper functions. 

\begin{Desc}
\item[Author:]James Swain -- \href{mailto:jswain@slac.stanford.edu}{\tt jswain@slac.stanford.edu}\end{Desc}


\subsection{Function Documentation}
\hypertarget{lrd_8h_a5}{
\index{lrd.h@{lrd.h}!RIM_compareType@{RIM\_\-compareType}}
\index{RIM_compareType@{RIM\_\-compareType}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-compareType]{\setlength{\rightskip}{0pt plus 5cm}int RIM\_\-compare\-Type (const char $\ast$ {\em string}, \hyperlink{lrd_8h_a0}{RIM\_\-type} {\em type})}}
\label{lrd_8h_a5}


Compare {\em string\/} with the name of {\em type\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]Name of a component type \item[{\em type}]Type to compare to \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em -1}]If the {\em type\/} is unknown (exceeds the range of acceptable types) \item[{\em 0}]If the {\em type\/} is known, and the name matches the {\em string\/} \item[{\em 1}]If the {\em type\/} is known, and the name does not match the {\em string\/} \end{description}
\end{Desc}
\hypertarget{lrd_8h_a9}{
\index{lrd.h@{lrd.h}!RIM_getAddress@{RIM\_\-getAddress}}
\index{RIM_getAddress@{RIM\_\-getAddress}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-getAddress]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-get\-Address (\hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$ {\em addr}, unsigned {\em index}, \hyperlink{lrd_8h_a0}{RIM\_\-type} {\em type})}}
\label{lrd_8h_a9}


Convert hierarchical bit addressing to flat addressing. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em addr}]Address to convert \item[{\em type}]Type of address to conver \item[{\em index}]Index corresponding to address \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]if the address is successfully converted to an index \item[{\em -2}]if any component of the address is outside the allowable range for this type\end{description}
\end{Desc}
Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr-$>$rc = (layer\-Number $<$$<$ 1) $|$ is\-Ylayer. This conversion is performed by the XLM-$>$RIM converter, but is documented here since it is a storage convention.\hypertarget{lrd_8h_a6}{
\index{lrd.h@{lrd.h}!RIM_getAddrRng@{RIM\_\-getAddrRng}}
\index{RIM_getAddrRng@{RIM\_\-getAddrRng}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-getAddrRng]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-get\-Addr\-Rng (const char $\ast$ {\em string}, \hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$ {\em addr})}}
\label{lrd_8h_a6}


Finds the address range associated with the type identifed by the string. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]Identifies the address range required \item[{\em addr}]Pointer to address stucture to populate with the address range \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-TYPE\_\-STR}]If the {\em string\/} does not match a known type \item[{\em RIM\_\-SUCCESS}]If the {\em string\/} is a good type name.\end{description}
\end{Desc}
\hypertarget{lrd_8h_a10}{
\index{lrd.h@{lrd.h}!RIM_getIndex@{RIM\_\-getIndex}}
\index{RIM_getIndex@{RIM\_\-getIndex}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-getIndex]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-get\-Index (const \hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$ {\em addr}, unsigned $\ast$ {\em index}, \hyperlink{lrd_8h_a0}{RIM\_\-type} {\em type})}}
\label{lrd_8h_a10}


Convert hierarchical bit addressing to flat addressing. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em addr}]Address to convert \item[{\em type}]Type of address to conver \item[{\em index}]Index corresponding to address \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]if the address is successfully converted to an index \item[{\em RIM\_\-ADDR\_\-BCAST}]if the address contains a mixture of broadcast and unicast components \item[{\em RIM\_\-ADDR\_\-RANGE}]if any component of the address is outside the allowable range for this type\end{description}
\end{Desc}
Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr-$>$rc = (layer\-Number $<$$<$ 1) $|$ is\-Ylayer. This conversion is performed by the XLM-$>$binary converter, but is documented here since it is a storage convention.\hypertarget{lrd_8h_a7}{
\index{lrd.h@{lrd.h}!RIM_getLayerID@{RIM\_\-getLayerID}}
\index{RIM_getLayerID@{RIM\_\-getLayerID}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-getLayerID]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-get\-Layer\-ID (char {\em sign}, char {\em xy}, char {\em index}, unsigned $\ast$ {\em layer})}}
\label{lrd_8h_a7}


Take three characters and convert them to a layer ID. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sign}]'+' or '-' \item[{\em xy}]'x' or 'y' \item[{\em index}]'0' -$>$ '8' \item[{\em layer}]Location to store the layer ID \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-ADDR\_\-LAYER}]If the layer information is nonsensical \item[{\em RIM\_\-SUCCESS}]If the layer ID was successfully found\end{description}
\end{Desc}
\hypertarget{lrd_8h_a8}{
\index{lrd.h@{lrd.h}!RIM_getLayerName@{RIM\_\-getLayerName}}
\index{RIM_getLayerName@{RIM\_\-getLayerName}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-getLayerName]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-get\-Layer\-Name (unsigned {\em layer}, char $\ast$ {\em sign}, char $\ast$ {\em xy}, char $\ast$ {\em index})}}
\label{lrd_8h_a8}


Get the characters of the layer name from the layer ID. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em layer}]ID of the layer to name \item[{\em sign}]Pointer to location to place the sign character \item[{\em xy}]Pointer to location to place the xy character \item[{\em index}]Pointer to location to place the index character \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LCI\_\-SUCCESS}]If the layer is located \item[{\em LCI\_\-ADDR\_\-LAYER}]If the layer is out of range\end{description}
\end{Desc}
\hypertarget{lrd_8h_a3}{
\index{lrd.h@{lrd.h}!RIM_lookupType@{RIM\_\-lookupType}}
\index{RIM_lookupType@{RIM\_\-lookupType}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-lookupType]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{lrd_8h_a0}{RIM\_\-type} RIM\_\-lookup\-Type (const char $\ast$ {\em string})}}
\label{lrd_8h_a3}


Hunt through the list of component types and return the index of the input string. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]String corresponding to one of the component types used in the LAT register description \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]integer corresponding to the type identified by {\em string\/} or RIM\_\-BAD\_\-TYPE if the string does not match any on the list\end{Desc}
\hypertarget{lrd_8h_a4}{
\index{lrd.h@{lrd.h}!RIM_nameType@{RIM\_\-nameType}}
\index{RIM_nameType@{RIM\_\-nameType}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-nameType]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-name\-Type (char $\ast$ {\em string}, \hyperlink{lrd_8h_a0}{RIM\_\-type} {\em type})}}
\label{lrd_8h_a4}


Place the four character string describing this type into {\em name\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]Type to be named \item[{\em string}]Location to place name \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]If the type is known to RIM \item[{\em RIM\_\-TYPE\_\-UK}]If the type is unknown\end{description}
\end{Desc}
\hypertarget{lrd_8h_a2}{
\index{lrd.h@{lrd.h}!RIM_nTypes@{RIM\_\-nTypes}}
\index{RIM_nTypes@{RIM\_\-nTypes}!lrd.h@{lrd.h}}
\subsubsection[RIM\_\-nTypes]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-n\-Types (void)}}
\label{lrd_8h_a2}


Return the number of component types within the LAT register description. 

\begin{Desc}
\item[Returns:]Number of component types\end{Desc}
