% -*- Mode:Text -*- 
\chapter{Controller chip schematics}\sectlabel{ctrlchip-schem}
\setcounter{page}{1}
\def\thepage{\Alph{chapter}-\arabic{page}}

This appendix contains the complete schematics for the three controller
chips. The nodes of the schematics hierarchy are called
\tdf{modules}.\footnote
	{These are Valid design modules, not to be confused with the physical
modules that make up a \step\ system.}

Most modules are in the form of \emph{circuit} schematics; the other modules,
having the tag `\id|_p|' at the end of their names, are \emph{state-machine}
tables.

The three hierarchy trees, headed by the nodes \id|ctlsvchip|, \id|dataregs|,
and \id|fsmchipand|, expand as follows\footnote
	{Two modules, namely \id|weight| and
\id|mff|, define very low-level primitives and have been omitted.}

{\small \verbatiminput{+ctrl-hier}\par}

\clearpage
\section{List of controller chip schematics}

The modules documented in the following pages appear in the order listed
below. Circuit schematics are given as PostScript files with extension
\id|ps|.  State-machine tables are given as text files with extension
\id|sm|. 

Thus, for example, module \id|dataregs| is documented by the
schematics \id|dataregs.ps|, while module \id|pty_p| is documented by the
state machine \id|pty.sm|.

\bigskip

\tableofsheets{losc}
\flushpage

\sheetgroup{Controller chips}

\def\processspecs#1 #2 #3 {\if#1p\chipsch{#2}{#3}{/fab/schematics/ifc}%
			    \else\chipfsm{#2}{#3}{/fab/schematics/ifc}\fi}


		% LOCATION AND TYPE OF SCHEMATICS
% ...{filename}{typeset filename}{path}

\newcommand{\chipsch}[3]{
    \newsheet{#2.ps}
    \vbox to\textheight{\vfill\hbox to\textwidth{\hfill
    \epsfig{file=#3/#1.ps,height=8.9in,bbllx=30,bblly=20,bburx=575,bbury=734}%
    \hfill}\vfill}
    \eject
}

\newcommand{\chipfsm}[3]{\verbcutroll{#2.sm}{#3/#1.sm}}



\shipspecs{+ctrl-schem.tex}
%\shipspecs{+test.tex}


\endinput

 % verbatim text roll to be cut into pages and numbered page-by-page
 \def\verbcutroll#1#2{%		#1=caption #2=file
	\newsheet{#1}
	\multipagetrue
	{\small\verbatimtabinput{#2}}
	\ifnum\value{page}=\value{sheetbasepage}\multipagefalse\fi
	\newpage
 }

	\newpage
	\setcounter{basepage}{\value{page}}
	\def\thedatapage{\setcounter{datapage}{\value{page}}
		\addtocounter{datapage}{-\value{basepage}}
		\addtocounter{datapage}{1}
		[\arabic{datapage}]}
	\dataheader{\whichchip\ schematics}{#2.sm}{\thedatapage}
	\datacaption{#2.sm}{}{\small
	\verbatiminput{#3/#1.sm}}}}
