%----------------------------------------------------------------------------
%
%  TRAP User Manual
%
%  author:  ASICCC
%  contact: University of Heidelberg
%           Kirchhoff-Institute of Physics
%           Chair of Computer Science / Computer Engineering
%           ti@kip.uni-heidelberg.de
%  created: 2003-05-26 - Rolf Schneider
%
%----------------------------------------------------------------------------

\documentclass[DIV15,BCOR15mm,headsepline,cleardoubleempty,halfparskip,bibtotoc]{scrbook}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{array}
\usepackage{color}
\definecolor{darkred}{rgb}{0.6,0.0,0.0}
\usepackage[dvipdfm, plainpages=false,%
  pdftitle={ALICE TRAP User Manual},%
  pdfauthor={ASICCC},%
  pdfsubject={User Manual},%q
  colorlinks=true,%
  linkcolor=darkred,%
  citecolor=darkred]{hyperref} % needs dvipdfm to be installed!

\setlength{\parindent}{0pt}
\renewcommand*{\capfont}{\normalfont\footnotesize}
\renewcommand*{\caplabelfont}{\sffamily\bfseries}
\setcapindent{0pt}

\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\newcommand{\tableC}{\PreserveBackslash{\centering}\hspace{0pt}}

%-- instruction set environment ---------------------------------------------
\newcommand{\hlink}[1]{\hyperlink{#1}{#1}}
\makeatletter\newcommand{\tableofinstructions}{\@starttoc{loi}}\makeatother
\newcommand{\bul}{$\bullet$}
\newcommand{\instruction}[9]{
 \addtocontents{loi}{
  \par
  \protect\footnotesize
  \protect\hyperlink{#1}{\protect\parbox[t]{1.4cm}{\sffamily\bfseries #1}}
  \protect\parbox[t]{1.2cm}{\sffamily\bfseries #3\hfill}
  \protect\parbox[t]{5.5cm}{#4\hfill}
  \protect\parbox[t]{6.8cm}{\protect\raggedright #2}
  \vspace{-1mm}
 }
 \newpage
 \hypertarget{#1}{\parbox[t]{0.25\textwidth}{\LARGE\sffamily\bfseries #1}}
 \parbox[t]{0.7\textwidth}{\LARGE\sffamily #2}
 \vspace{0.8cm}

 \parbox[t]{0.25\textwidth}{\textbf{syntax}}
 \parbox[t]{0.7\textwidth}{\texttt{#1 #3}}
 \vspace{0.3cm}

 \parbox[t]{0.25\textwidth}{\textbf{operation}}
 \parbox[t]{0.7\textwidth}{#4}
 \vspace{0.3cm}

 \parbox[t]{0.25\textwidth}{\textbf{opcode}}
 \parbox[t]{0.7\textwidth}{\texttt{#5}}
 \vspace{0.3cm}

 \parbox[t]{0.25\textwidth}{\textbf{description}}
 \parbox[t]{0.7\textwidth}{#6}
 \vspace{0.3cm}

 \parbox[t]{0.25\textwidth}{\textbf{condition flags}}
 \parbox[t]{0.7\textwidth}{ \vspace{-2.5mm}
  \begin{tabular}[t]{*{5}{|>{\tableC}p{1.5cm}}|} \hline
   Zero & Carry & Negative & TCO & Signed \\ \hline
   #7 \\ \hline
  \end{tabular}
  \vspace{0.3cm}\par
  \begin{tabular}[t]{@{}p{1.5cm}l}
   #8
  \end{tabular} \vspace{0pt}
 }
 \vspace{0.5cm}

 \parbox[t]{0.25\textwidth}{\textbf{addressing modes}}
 \begin{tabular}[t]{@{}p{1.5cm}l}
  #9
 \end{tabular}
}

%-- register environment ---------------------------------------------
\newcommand{\reg}[1]{\mbox{\sffamily\bfseries #1}}
\makeatletter\newcommand{\tableofregisters}{\@starttoc{lor}}\makeatother
\newcommand{\register}[7]{
 \addtocontents{lor}{
  \par
  \protect\footnotesize
  \protect\hyperlink{#1}{\protect\parbox[t]{1.8cm}{\sffamily\bfseries #1}}
  \protect\parbox[t]{1.5cm}{\ttfamily #2}
  \protect\parbox[t]{6.7cm}{\ttfamily #5}
  \protect\parbox[t]{4.9cm}{\protect\raggedright #3}
  \vspace{-1mm}
 }

 \hypertarget{#1}{\fbox{
  \parbox[t]{2.1cm}{\sffamily\bfseries #1}
  \parbox[t]{2.2cm}{\ttfamily #2}
  \parbox[t]{10.2cm}{\bfseries #3}}}
 
 {\small
 \parbox[t]{2.4cm}{ \hfill }
 \parbox[t]{2.2cm}{\bfseries description}
 \parbox[t]{10.2cm}{#4}
 \vspace{-2mm}

 \parbox[t]{2.4cm}{ \hfill }
 \parbox[t]{2.2cm}{\bfseries register}
 \parbox[t]{10.2cm}{\ttfamily #5}
 \vspace{-2mm}

 \parbox[t]{2.4cm}{ \hfill }
 \parbox[t]{2.2cm}{\bfseries reset value}
 \parbox[t]{10.2cm}{\ttfamily #6}
 \ifx1#71

 \else
  \vspace{-2.5mm}

  \parbox[t]{2.4cm}{ \hfill }
  \parbox[t]{2.2cm}{\bfseries entries}
  \parbox[t]{10.2cm}{
   \begin{tabular}[t]{@{}>{\ttfamily}p{0.2cm}p{9.3cm}}
    #7
   \end{tabular}
  }
 \fi
 }
}

% fuer Trapadc eingefuegt, D. Muthers 6.11.2003
\usepackage{longtable}
\setlongtables


%----------------------------------------------------------------------------
\begin{document}
\frontmatter

%----------------------------------------------------------------------------
%  TITLE
%----------------------------------------------------------------------------
\begin{titlepage}
 \begin{center}
  \vspace*{1cm}
  {\Huge\sffamily\bfseries ALICE TRAP} \\
  \vspace*{0.4cm}
  {\LARGE\sffamily\bfseries User Manual} \\
  \vspace*{3cm}
  {\huge\sffamily\bfseries ASICCC} \\
  \vspace*{1cm}
  {\scriptsize
  \parbox[t]{6.5cm}{
   {\Large\sffamily University of Heidelberg} \\
   Kirchhoff Institute of Physics \\
   Chair of Computer Science \\
   Prof.~Dr.~Volker Lindenstruth
  }
  \parbox[t]{6.5cm}{
   Dr.~Venelin Angelov,
   Jan de~Cuveland,
   Markus Dorn,
   Marcus Gutfleisch,
   Prof.~Dr.~Volker Lindenstruth,
   Christian Reichling,
   Rolf Schneider,
%   Prof.~Dr.~Christoph Scholl
  }\\
  \vspace*{1cm}
  \parbox[t]{6.5cm}{
   {\Large\sffamily University of Mannheim} \\
   Department of Computer Engineering \\
   Prof.~Dr.~Ulrich Brüning
  }
  \parbox[t]{6.5cm}{
   Prof.~Dr.~Ulrich Brüning,
   Holger Fröning,
   Patrick Haspel
  }\\
  \vspace*{1cm}
  \parbox[t]{6.5cm}{
   {\Large\sffamily University of Kaiserslautern} \\
   Institute for Microelectronics \\
   Prof.~Dr.~Reinhard Tielert
  }
  \parbox[t]{6.5cm}{
   David Muthers,
   Axel Schmitz,
   Prof.~Dr.~Reinhard Tielert,
   Marc Wegener
  }\\
  \vspace*{1cm}
  \parbox[t]{6.5cm}{
   {\Large\sffamily GSI Darmstadt} \\
   Holger Flemming
  }
  \parbox[t]{6.5cm}{
    Holger Flemming
%   David Muthers,
%   Axel Schmitz,
%   Prof.~Dr.~Reinhard Tielert,
%   Marc Wegener
  }}\\
  \vfill
  {\footnotesize Revision 1.1}\\
  {\footnotesize 2005-01-03}\\
 \end{center}
\end{titlepage}

%----------------------------------------------------------------------------
%  ABSTRACT & TABLES
%----------------------------------------------------------------------------
\input{abstract.tex}
\tableofcontents
\listoffigures
\listoftables

%----------------------------------------------------------------------------
%  CHAPTERS
%----------------------------------------------------------------------------
\mainmatter
\input{chap_intro/chap.tex}
\input{chap_sm/chap.tex}
\input{chap_scsn/chap.tex}
\input{chap_lvds/chap.tex}
\input{chap_adc/chap.tex}
\input{chap_chipid/chap.tex}
\input{chap_tpp/chap.tex}
\input{chap_tp/chap.tex}
\input{chap_ni/chap.tex}

%----------------------------------------------------------------------------
%  REFERENCES and APPENDIX
%----------------------------------------------------------------------------
\input{biblio.tex}
\begin{appendix}
\input{chap_appendix/chap.tex}
\end{appendix}

%----------------------------------------------------------------------------
\end{document}
