\documentstyle[12pt,timrom]{article}
\setlength{\topmargin}{-.5in}
\addtolength{\textheight}{1in}
\addtolength{\oddsidemargin}{-.5in}
\addtolength{\evensidemargin}{-.5in}
\addtolength{\textwidth}{1in}
\markboth{{\bf funclib/and.c \today}}{{\bf funclib/and.c \today}}
\pagestyle{myheadings}
\thispagestyle{myheadings}
\newcommand{\four}{\hspace{6ex}}
\title{funclib/and.c}
\author{eichin}
\date{Apr 6 09:53}
\begin{document}
\maketitle
\newpage
\rm
\begin{tabbing}
\em/\=\em* \\
\>\em* and.c\\
\>\em* a few pieces for a running simulator.\\
\>\em* \verb+[+eichin:19880401.0606EST\verb+]+\\
 \em*/\\\four\{\}\=\four\{\}\=\four\{\}\=\four\{\}\=\four\{\}\=\four\=\four\{\}\=\four\{\}\=\four\{\}\=\four\{\}\=\kill\\
{\bf \#include} "../ms/macdefs.h"\\
{\bf \#include} "../decls.h"\\
\ \\
\em/\=\em* \\
\>\em* z = and(a, b...): if (a==HI) then and(b...) else LOW\\
 \em*/\\\four\{\}\=\four\{\}\=\four\{\}\=\four\{\}\=\four\{\}\=\four\=\four\{\}\=\four\{\}\=\four\{\}\=\four\{\}\=\kill \\
and\_func(dep)\\
\>\> {\bf Generics} dep;\\
\{\\
\>{\bf Event} futev = getblock();\\
\>{\bf Wire} outwire;\\
\>{\bf {\bf Time}line} outtime;\\
\ \\
\>START(futev);\\
\>set\_event(futev, LOGIC\_HI, globaltime + 10);\\
\ \\
\>outwire = dep$\rightarrow$data.GENERIC.genwire;\\
\>find\_item(outwire, WIRE, FUTURE);\\
\>outtime = outwire$\rightarrow$data.WIRE.future;\\
\>INC(dep);\\
\ \\
\>while(dep$\rightarrow$tag.CTL != END)\\
\>\>\{\\
\>\>  {\bf Wire} awire = dep$\rightarrow$data.GENERIC.genwire;\\
\>\>  ASSERT(dep$\rightarrow$tag.GENERIC == GENWIRE);\\
\ \\
\>\>  find\_item(awire, WIRE, NOW);\\
\ \\
\>\>  if((awire$\rightarrow$data.WIRE.now)$\rightarrow$tag.EVENT == LOGIC\_HI)\\
\>\>\>\{\\
\>\>\>  INC(dep);\\
\>\>\>  continue;\\
\>\>\>\}\\
\>\>  else\\
\>\>\>\{\\
\>\>\>  set\_event(futev, LOGIC\_LOW, globaltime + 10);\\
\>\>\>  break;\\
\>\>\>\}\\
\>\>\}\\
\ \\
\>add\_event(outtime, futev$\rightarrow$tag.EVENT, futev$\rightarrow$data.EVENT);\\
\>back\_trace(futev);\\
\}\\
\end{tabbing}
\end{document}
