18f0b22d7bc603eb942b1f091120be70a1792052
[fleet.git] / am33.tex
1 \documentclass[10pt]{article}
2 \usepackage{palatino}
3 \usepackage{amsmath}
4 \usepackage{epsfig}
5 \usepackage{color}
6 \usepackage{bytefield1}
7 \usepackage{wrapfig}
8 \usepackage{stmaryrd}
9 \usepackage{subfigure}
10 \usepackage{syntax}
11 \usepackage{comment}
12 \usepackage{fancyhdr}
13 \usepackage{lastpage}
14 \usepackage{multirow}
15 \usepackage{multicol}
16 \usepackage{rotating}
17 \include{megacz}
18 \bibliographystyle{alpha}
19 \pagestyle{fancyplain}
20
21 \definecolor{light}{gray}{0.7}
22
23 \newcommand{\footnoteremember}[2]{
24   \footnote{#2}
25   \newcounter{#1}
26   \setcounter{#1}{\value{footnote}}
27 } \newcommand{\footnoterecall}[1]{
28   \footnotemark[\value{#1}]
29 }
30
31 %\pdfpagewidth 8.5in
32 %\pdfpageheight 11in 
33 %\topmargin 0in
34 %\textheight 7.5in
35 %\textwidth 6.0in
36 %\oddsidemargin 0.25in
37 %\evensidemargin 0.25in
38 %\headwidth 6.0in
39 \def\to{\ $\rightarrow$\ }
40
41 \def\docnum{AM33}
42
43 \author{
44 \normalsize{
45 \begin{tabular}{c}
46 \end{tabular}}
47 }
48
49 \title{\vspace{-1cm}The FleetTwo Dock}
50
51 \begin{document}
52
53 \maketitle
54
55 \begin{abstract}
56 Changes:
57
58 \begin{tabular}{rl}
59 \color{red}
60 29-Mar
61 \color{black}
62 & removed the {\tt L} flag (epilogues can now do this) \\
63 & removed {\tt take\{Inner|Outer\}LoopCounter} instructions \\
64 & renamed {\tt data} instruction to {\tt literal} \\
65 & renamed {\tt send} instruction to {\tt move} \\
66 \color{red}
67 23-Mar
68 \color{black}
69 & added ``if its predicate is true'' to repeat count \\
70 & added note that red wires do not contact ships \\
71 & changed name of {\tt flags} instruction to {\tt setFlags} \\
72 & removed black dot from diagrams \\
73 & changed {\tt OL} (Outer Loop participant) to {\tt OS} (One Shot) and inverted polarity \\
74 & indicated that the death of the {\tt tail} instruction is what causes the hatch to be unsealed \\
75 & indicated that only {\tt send} instructions which wait for data are torpedoable \\
76 & added section ``Torpedo Details'' \\
77 & removed {\tt torpedo} instruction \\
78 12-Mar
79 \color{black}
80 & renamed loop+repeat to outer+inner (not in red) \\
81 & renamed {\tt Z} flag to {\tt L} flag (not in red) \\
82 & rewrote ``inner and outer loops'' section \\
83 & updated all diagrams \\
84 \color{black}
85 7-Mar
86 & Moved address bits to the LSB-side of a 37-bit instruction \\
87 & Added {\it micro-instruction} and {\it composite instruction} terms \\
88 & Removed the {\tt DL} field, added {\tt decrement} mode to {\tt loop} \\
89 & Created the {\tt Hold} field \\
90 & Changed how ReLooping works \\
91 & Removed {\tt clog}, {\tt unclog}, {\tt interrupt}, and {\tt massacre} \\
92 \end{tabular}
93 \end{abstract}
94
95 \vfill
96
97 \begin{center}
98 \epsfig{file=overview,width=1.5in}
99 \epsfig{file=indock,width=3in}
100 \end{center}
101
102 \pagebreak
103
104 \section{Overview of Fleet}
105
106 A Fleet processor consists of a {\it switch fabric} with several
107 functional units called {\it ships} connected to it.  At each
108 connection between a ship and the switch fabric lies a programmable
109 element known as the {\it dock}.
110
111 A {\it path} specifies a route through the switch fabric from a
112 particular {\it source} to a particular {\it destination}.  The
113 combination of a path and a single word {\it payload} is called a {\it packet}.  The
114 switch fabric carries packets from their sources to their
115 destinations.  Each dock has two destinations: one for {\it
116   instructions} and one for {\it data}.  A Fleet is programmed by
117 depositing packets into the switch fabric; these packets' paths lead
118 them to the instruction destinations of the docks.
119
120 When a packet arrives at the instruction destination of a dock, it is
121 enqueued for execution.  Before the instruction executes, it may cause
122 the dock to wait for a packet to arrive at the dock's data destination
123 or for a value to be presented by the ship.  It may present a data
124 value to the ship or transmit it for transmission to some other
125 destination.
126
127 When an instruction sends a packet into the switch fabric, it may
128 specify that the payload of the packet is irrelevant.  Such packets
129 are known as {\it tokens}, and consume less energy than data packets.
130 From a programmer's perspective, a token packet is indistinguishable
131 from a data packet with a unknown payload.
132
133 \color{red}
134 In the diagram below, the red wires carry instructions and the blue
135 wires carry data; the switch fabric (gray area) carries both.  Notice
136 that the red (instruction) wires do not contact the ships.  This is an
137 advantage: ships are designed without any consideration for the
138 instructions used to program their docks.
139 \color{black}
140
141 \begin{center}
142 \epsfig{file=overview,width=2.5in}\\
143 {\it Overview of a Fleet processor; gray shading represents a
144   packet-switched network fabric; blue lines carry data, red lines
145   carry instructions.}
146 \end{center}
147 \color{black}
148
149 \pagebreak
150
151 \section{The FleetTwo Pump}
152
153 The diagram below represents a {\it programmer's} conceptual view of
154 the interface between ships and the switch fabric.  Actual
155 implementation circuitry may differ substantially.  Sources and
156 destinations that can send and receive only tokens -- not data items
157 -- are drawn as dashed lines.
158
159 \begin{center}
160 \epsfig{file=indock,width=3.5in}\\
161 {\it an ``input'' dock}
162
163 \epsfig{file=outdock,width=3.5in}\\
164 {\it an ``output'' dock}
165 \end{center}
166
167 The term {\it port} refers to an interface to the ship, the {\it
168   dock} connecting it to the switch fabric, and the corresponding
169 sources and destinations on the switch fabric.
170
171 Each dock consists of a {\it data latch}, which is as wide as a single
172 machine word and a {\it pump}, which is a circular fifo of
173 instruction-width latches.  The values in the pump control the data
174 latch.
175
176 Note that the pump in each dock has a destination of its own; this is
177 the {\it instruction destination} mentioned in the previous section.
178 Note that unlike all other destinations, there is no buffering fifo
179 guarding this one.  The size of these fifos are exposed to the
180 software programmer so he can avoid deadlock.
181
182 \pagebreak
183 \section{Instructions}
184
185 In order to cause an instruction to execute, the programmer must first
186 cause that instruction word to arrive in the data latch of some output
187 dock.  For example, this might be the ``data read'' output dock of the
188 memory access ship or the output of a fifo ship.  Once an instruction
189 has arrived at this output dock, it is {\it dispatched} by sending it
190 to the {\it instruction port} of the dock at which it is to execute.
191
192 Each instruction is 26 bits long, which makes it possible for an
193 instruction and an 11-bit path to fit in a single word of memory.
194 This path is the path from the {\it dispatching} dock to the {\it
195   executing} dock.
196
197 \setlength{\bitwidth}{3.5mm}
198 {\tt \footnotesize
199 \begin{bytefield}{37}
200   \bitheader[b]{0,10,11,36}\\
201   \bitbox{26}{instruction} 
202   \bitbox{11}{dispatch path} 
203 \end{bytefield}}
204
205 {\bf Note:} the instruction encodings below are simply ``something to
206 shoot at'' and a sanity check to make sure we haven't overrun our bit
207 budget.  The final instruction encodings will probably be
208 different.
209
210 All instruction words have the following format:
211
212 \setlength{\bitwidth}{3.5mm}
213 {\tt \footnotesize
214 \begin{bytefield}{37}
215   \bitheader[b]{0,10,11,36}\\
216 \color{black}
217   \bitbox{1}{\color{red}I\color{black}} 
218   \bitbox{1}{\color{red}OS\color{black}} 
219   \bitbox{2}{P} 
220 \color{light}
221   \bitbox[tbr]{22}{} 
222   \bitbox{11}{dispatch path} 
223 \color{black}
224 \end{bytefield}}
225
226 Each instruction word is called a {\it micro instruction}.
227 Collections of one or more micro instruction are known as {\it
228   composite instructions}.
229
230 \color{red}
231 The {\tt I} bit stands for {\tt Interruptible}\color{black}.  The \color{red}{\tt OS}
232 (``One Shot'')\color{black}\ bit indicates whether or not this instruction is part
233 of an outer loop.  Both of the preceding bits are explained in the
234 next section.
235
236 \color{black}
237
238 The abbreviation {\tt P} stands for {\it predicate}; this is a two-bit
239 code that indicates if the instruction should be executed or ignored.
240
241
242
243 \pagebreak
244 \subsection{Life Cycle of an Instruction}
245
246 The diagram below shows an input dock for purposes of illustration
247 (behavior at an output dock is identical).
248
249 \begin{center}
250 \epsfig{file=indock,width=3in}\\
251 {\it an input dock}
252 \end{center}
253
254 Note the circle on the path between ``instr horn'' and ``instr fifo'';
255 this is known as ``the hatch''.  The hatch has two states: sealed and
256 unsealed.  When the machine powers up, the hatch is unsealed; it is
257 sealed by the {\tt tail} instruction and unsealed \color{red}whenever
258 the outer loop counter is set to zero (for any
259 reason\footnote{\color{red}this includes {\tt OLC} being decremented
260   to zero, a {\tt setOuter} with a literal field of zero, a {\tt
261     setOuter} which copies a zero from the data register to {\tt OLC},
262   or the occurrence of a torpedo\color{black}}).\color{black}
263
264 When an instruction arrives at the instruction horn, it waits there
265 until the hatch is in the unsealed state.  The instruction then enters
266 the instruction fifo.  When an instruction emerges from the
267 instruction fifo, it arrives at the ``on deck'' stage, where it may
268 execute.
269
270 \subsubsection{Inner and Outer Loops}
271
272 A programmer can perform two types of loops: {\it inner} loops of only
273 one micro-instruction and {\it outer} loops of multiple
274 micro-instructions.  Inner loops may be nested within an outer loop,
275 but no other nesting of loops is allowed.  The paths used by inner
276 loops and outer loops are shown below:
277
278 \begin{center}
279 \begin{minipage}{2in}
280 \begin{center}
281 \epsfig{file=inner-loop,width=2in}\\
282 {\it inner loop (in red)}
283 \end{center}
284 \end{minipage}
285 \begin{minipage}{2in}
286 \begin{center}
287 \epsfig{file=outer-loop,width=2in}\\
288 {\it outer loop (in red)}
289 \end{center}
290 \end{minipage}
291 \end{center}
292
293 \color{red}
294
295 Each type of loop has a counter associated with it: the {\tt ILC}
296 counter for inner loops and the {\tt OLC} counter for outer loops.
297 The inner loop counter applies only to certain ``inner-looping''
298 instructions (see the table below for details).  When such an
299 instruction reaches On Deck, if its predicate is true it will execute
300 a number of times equal to {\tt ILC+1}, and leave {\tt ILC=0} after
301 executing.  Non-inner-looping instructions and instructions whose
302 predicate is false do not decrement {\tt ILC}.
303
304 The outer loop counter applies to all instructions {\it except} the
305 instruction {\tt setOuter} with {\tt OS=1}, because such instructions
306 are needed to reset the outer loop counter after it becomes zero.
307 However, predicated {\tt setOuter} with {\tt OS=0} is useful for
308 resetting the loop counter in the middle of the execution of a loop.
309
310 \color{black}
311
312 \subsubsection{On Deck}
313 \color{red} The
314 table below lists the actions which may be taken when an
315 instruction arrives on deck:
316
317 \begin{center}
318 \def\side#1{\begin{sideways}\parbox{15mm}{#1}\end{sideways}}
319 \begin{tabular}{|r|ccccc|cccccc|}\hline
320 %&\multicolumn{10}{c}{Predicate}&\\
321 %&\multicolumn{10}{c}{True}&\\\hline
322 &\multicolumn{5}{c}{Outer-Looping} &\multicolumn{5}{c}{One-Shot}&\\
323 &\multicolumn{5}{c}{{\tt (OS=0)}} &\multicolumn{5}{c}{{\tt (OS=1)}}&\\
324 &\side{{\tt move}}
325 &\side{{\tt literal}}
326 &\side{{\tt setFlags}}
327 &\side{{\tt setInner}}
328 &\side{{\tt setOuter}}
329 &\side{{\tt move}}
330 &\side{{\tt literal}}
331 &\side{{\tt setFlags}}
332 &\side{{\tt setInner}}
333 &\side{{\tt setOuter}}
334 &
335 \\\hline
336 Wait for hatch sealed         & +        & + & + & + & +  &          &   &   &   &   &  \\
337 Fill IF0 w/ copy of self      & +        & + & + & + & +  &          &   &   &   &   &  \\\hline
338 Request arbiter               & P+$\star$ &   &   &   &    & P+$\star$ &   &   &   &   &  \\
339 Potentially torpedoable       & P+$\star$ &   &   &   &    & P+$\star$ &   &   &   &   &  \\\hline
340 Execute                       & P+       & P+& P+& P+& P+ & ?        & ? & ? & ? & P &  \\
341 Inner-looping                 & P+       &   &   &   & ?  & P+       &   &   &   & ? &  \\
342 \hline
343 \end{tabular}
344
345 \begin{tabular}{|r|l|}\hline
346 +       & Only if {\tt OLC>0} (ie {\tt OLC} is positive) \\
347 P       & Only if predicate is true \\
348 P+      & Only if predicate is true and {\tt OLC>0} \\
349 P+$\star$ & Only if predicate is true and {\tt OLC>0} and {\tt I=1} and one of {\tt Ti},{\tt Di},{\tt Do} true. \\
350 ?       & to discuss \\\hline
351 \end{tabular}
352 \end{center}
353
354 \subsubsection{\color{red}Torpedo\color{black}}
355
356 \color{red}
357 There is a small fifo (not shown) before the latch marked
358 ``Instruction Horn''; after the {\tt tail} instruction seals the
359 hatch, any subsequent instructions will queue up in this fifo until
360 the hatch is unsealed.  This is typically used as storage for a ``loop
361 epilogue'' -- a sequence of instructions to be executed after a
362 torpedo arrives or the outer loop counter expires.
363
364 Each dock has a fourth connection to the switch fabric (not shown),
365 called its {\it torpedo destination}.  Anything (even a token) sent to
366 this destination is treated as a torpedo.  Note that because this is a
367 distinct destination, instructions or data queued up in the other
368 destination fifos will not prevent a torpedo from occuring.
369
370 When a data item or token arrives at the torpedo destination, it lies
371 there in wait until On Deck holds a potentially torpedoable
372 instruction (see previous table).  Once this is the case, the torpedo
373 causes the inner and outer loop counters to be set to zero (and
374 therefore also unseals the hatch).\footnote{it is unspecified whether
375   the torpedoed instruction is requeued or not; this may or may not
376   occur, nondeterministically.  It is the programmer's responsibility
377   to ensure that the program behaves the same whether this happens or
378   not.  We think that this will not matter in most situations.}
379
380 \color{black}
381
382
383 \subsection{Flags}
384
385 The pump has \color{red}three\color{black}\ flags: {\tt A}, {\tt B},
386 and {\tt S}.
387
388 \begin{itemize}
389 \item The {\tt A} and {\tt B} flags are general-purpose flags which
390       may be set and cleared by the programmer.
391
392 %\item
393 %
394 % The {\tt L} flag, known as the {\it last} flag, is set whenever
395 %      the value in the outer counter ({\tt OLC}) is one,
396 \color{black}
397 % indicating
398 %      that the dock is in the midst of the last iteration of an
399 %      outer loop.  This flag can be used to perform certain
400 %      operations (such as sending a completion token) only on the last
401 %      iteration of an outer loop.
402
403 \item The {\tt S} flag, known as the {\it summary} flag.  Its value is
404       determined by the ship, but unless stated otherwise, it should
405       be assumed that whenever the 37th bit of the data ({\tt D})
406       latch is loaded, that same bit is also loaded into the {\tt S}
407       flag.  This lets the ship make decisions based on whether or not
408       the top bit of the data latch is set; if two's complement
409       numbers are in use, this will indicate whether or not the
410       latched value is negative.
411 \end{itemize}
412
413 Many instruction fields are specified as two-bit {\it predicates}.
414 These fields contain one of four values, indicating if an action
415 should be taken unconditionally or conditionally on one of the {\tt A}
416 or {\tt B} flags:
417
418 \begin{itemize}
419 \item {\tt 00:} if {\tt A} is set
420 \item {\tt 10:} if {\tt B} is set
421 \item {\tt 01:} \color{red}TBD\color{black}
422 \item {\tt 11:} always
423 \end{itemize}
424
425
426 \pagebreak
427 \section{Instructions}
428
429 \color{red}
430
431 Here is a list of the instructions supported by the dock:
432
433 \begin{center}
434 \begin{tabular}{|l|}\hline
435 {\tt move} (variants: {\tt moveto}, {\tt dispatch}) \\
436 {\tt literal} (variants: {\tt literalhi}, {\tt literallo})\\
437 {\tt setFlags} \\
438 {\tt setInner} \\
439 {\tt setOuter} \\
440 %{\tt torpedo} \\
441 {\tt tail} \\\hline
442 \end{tabular}
443 \end{center}
444
445 {\tt tail} {\it will probably become a bit on every instruction rather than
446   its own instruction}
447
448 \color{black}
449
450
451 \subsection{{\tt move} (variants: {\tt moveto}, {\tt dispatch})}
452
453 \setlength{\bitwidth}{5mm}
454 {\tt
455 \begin{bytefield}{26}
456   \bitheader[b]{12-16,19,21}\\
457 \color{light}
458   \bitbox{1}{I}
459   \bitbox{1}{OS}
460   \bitbox{2}{P}
461 \color{black}
462    \bitbox{3}{001} 
463 \color{light}
464   \bitbox[trb]{2}{} 
465 \color{black}
466   \bitbox{1}{\tt Ti}
467   \bitbox{1}{\tt Di}
468   \bitbox{1}{\tt Dc}
469   \bitbox{1}{\tt Do}
470   \bitbox{1}{\tt To}
471   \bitbox[l]{17}{}
472 \end{bytefield}}
473
474 %\begin{bytefield}{26}
475 %  \bitheader[b]{12-18}\\
476 %  \bitbox[]{8}{\raggedleft Input Dock:}
477 %  \bitbox[r]{2}{}
478 %  \bitbox{1}{\tt So} 
479 %  \bitbox{1}{\tt Dc}
480 %  \bitbox[l]{15}{}
481 %\end{bytefield}
482 %
483 %\begin{bytefield}{26}
484 %  \bitheader[b]{12-18}\\
485 %  \bitbox[]{8}{\raggedleft Output Dock:}
486 %  \bitbox[r]{2}{}
487 %  \bitbox{1}{\tt Si}
488 %  \bitbox{1}{\tt To}
489 %  \bitbox[l]{15}{}
490 %\end{bytefield}
491
492 \begin{bytefield}{26}
493   \bitheader[b]{0,10,11}\\
494   \bitbox[1]{13}{\raggedleft {\tt moveto} ({\tt LiteralPath\to Path})}
495   \bitbox[r]{1}{}
496   \bitbox{1}{\tt 1}
497   \bitbox{11}{\tt LiteralPath}
498 \end{bytefield}
499
500 \begin{bytefield}{26}
501   \bitheader[b]{10,11}\\
502   \bitbox[1]{13}{\raggedleft {\tt dispatch} ({\tt DP[37:27]\to Path})\ \ }
503   \bitbox[r]{1}{}
504   \bitbox{1}{\tt 0}
505   \bitbox{1}{\tt 1}
506 \color{light}
507   \bitbox[trb]{10}{}
508 \color{black}
509 \end{bytefield}
510
511 \begin{bytefield}{26}
512   \bitheader[b]{10,11}\\
513   \bitbox[1]{13}{\raggedleft {\tt move} ({\tt Path} unchanged):}
514   \bitbox[r]{1}{}
515   \bitbox{1}{\tt 0}
516   \bitbox{1}{\tt 0}
517 \color{light}
518   \bitbox[trb]{10}{}
519 \color{black}
520 \end{bytefield}
521
522 \begin{itemize}
523 \item {\tt Ti} - Token Input: wait for the token predecessor to be full and drain it.
524 \item {\tt Di} - Data Input: wait for the data predecessor to be full and drain it.
525 \item {\tt Dc} - Data Capture: pulse the data latch.
526 \item {\tt Do} - Data Output: fill the data successor.
527 \item {\tt To} - Token Output: fill the token successor.
528 \end{itemize}
529
530 The data successor and token successor must both be empty in order for
531 a {\tt move} instruction to attempt execution.
532
533 The inner loop counter can hold a number {\tt 0..MAX} or a special
534 value $\infty$.  If {\tt ILC} is nonzero after execution of a {\tt
535   move} instruction, the instruction will execute again, and {\tt ILC}
536 will be latched with {\tt (ILC==$\infty$?$\infty$:max(ILC-1, 0))}.  When
537 the inner loop counter reaches zero, the instruction ceases executing.
538
539
540 \pagebreak
541 \subsection{{\tt literal}, {\tt literalhi}, {\tt literallo}}
542
543 These instructions load part or all of the data latch ({\tt D}).
544
545 {\tt literalhi: Literal[18:1]\to D[37:20]} (and {\tt Literal[18]\to S})
546
547 \setlength{\bitwidth}{5mm}
548 {\tt
549 \begin{bytefield}{26}
550   \bitheader[b]{0,18,19,21}\\
551 \color{light}
552   \bitbox{1}{I}
553   \bitbox{1}{OS} 
554   \bitbox{2}{P}
555 \color{black}
556   \bitbox{1}{0} 
557   \bitbox{2}{11} 
558 \color{light}
559   \bitbox[trb]{1}{} 
560 \color{black}
561   \bitbox{18}{Literal} 
562 \end{bytefield}}
563
564 {\tt literallo: Literal[19:1]\to D[19:1]}
565
566 \setlength{\bitwidth}{5mm}
567 {\tt
568 \begin{bytefield}{26}
569   \bitheader[b]{0,18,19,21}\\
570 \color{light}
571   \bitbox{1}{I}
572   \bitbox{1}{OS} 
573   \bitbox{2}{P}
574 \color{black}
575   \bitbox{1}{0} 
576   \bitbox{2}{10} 
577   \bitbox{19}{Literal} 
578 \end{bytefield}}
579
580 {\tt literal:}
581
582 \setlength{\bitwidth}{5mm}
583 {\tt
584 \begin{bytefield}{26}
585   \bitheader[b]{0,18,19,21}\\
586 \color{light}
587   \bitbox{1}{I}
588   \bitbox{1}{OS} 
589   \bitbox{2}{P}
590 \color{black}
591   \bitbox{1}{1} 
592   \bitbox{2}{SEL} 
593   \bitbox{19}{Literal} 
594 \end{bytefield}}
595
596 {\tt
597 \begin{tabular}{|r|c|c|c|}\hline
598 sel  & D[37:20]      & D[19:1]       \\\hline
599 00  & Literal[18:1] & all 0         \\
600 01  & Literal[18:1] & all 1         \\
601 10  & all 0         & Literal[19:1] \\
602 11  & all 1         & Literal[19:1] \\
603 \hline
604 \end{tabular}}
605
606
607
608
609 \subsection{
610 \color{red}
611 {\tt setFlags}
612 \color{black}
613 }
614
615 \setlength{\bitwidth}{5mm}
616 {\tt
617 \begin{bytefield}{26}
618   \bitheader[b]{0,7,8,15,16-19,21}\\
619 \color{light}
620   \bitbox{1}{I}
621   \bitbox{1}{OS} 
622   \bitbox{2}{P}
623 \color{black}
624   \bitbox{3}{000}
625   \bitbox{1}{0}
626 \color{red}
627   \bitbox{6}{nextA}
628   \bitbox{6}{nextB}
629   \bitbox{6}{nextS}
630 \color{black}
631 \end{bytefield}}
632
633 The {\tt P} field is a predicate; if it does not hold, the instruction
634 is ignored.  Otherwise the flags are updated according to the {\tt
635   nextA}, {\tt nextB}, and {\tt nextS} fields; each specifies the new
636 value as the logical {\tt OR} of zero or more inputs:
637
638 \begin{center}
639 {\tt
640 \begin{bytefield}{6}
641   \bitheader[b]{0-5}\\
642   \bitbox{1}{${\text{\tt A}}$}
643   \bitbox{1}{$\overline{\text{\tt A}}$}
644   \bitbox{1}{${\text{\tt B}}$}
645   \bitbox{1}{$\overline{\text{\tt B}}$}
646   \bitbox{1}{${\text{\tt S}}$}
647   \bitbox{1}{$\overline{\text{\tt S}}$}
648 \end{bytefield}}
649 \end{center}
650
651 Each bit corresponds to one possible input; all inputs whose bits are
652 set are {\tt OR}ed together, and the resulting value is assigned to
653 the flag.  Note that if none of the bits are set, the value assigned
654 is zero.  Note also that it is possible to produce a {\tt 1} by {\tt
655   OR}ing any flag with its complement.
656
657
658 \pagebreak
659
660 \subsection{{\tt setInner}}
661
662 This instruction loads the inner loop counter with either a literal
663 number, the special value $\infty$, or the contents of the {\tt data}
664 register.
665
666 \setlength{\bitwidth}{5mm}
667 {\tt
668 \begin{bytefield}{26}
669   \bitheader[b]{16-19,21}\\
670 \color{light}
671   \bitbox{1}{I}
672   \bitbox{1}{OS} 
673   \bitbox{2}{P}
674 \color{black}
675   \bitbox{3}{000}
676   \bitbox{1}{1}
677   \bitbox{2}{01}
678 \color{light}
679   \bitbox[tbr]{8}{}
680   \bitbox[l]{8}{}
681 \color{black}
682 \end{bytefield}}\\
683
684 \begin{bytefield}{26}
685   \bitbox[r]{18}{\raggedleft from data latch:\hspace{0.2cm}\ }
686   \bitbox{2}{\tt 00}
687 \color{light}
688   \bitbox[tbr]{6}{} 
689 \color{black}
690 \end{bytefield}
691
692 \begin{bytefield}{26}
693   \bitheader[b]{0,5,6,7}\\
694   \bitbox[r]{18}{\raggedleft from literal:\hspace{0.2cm}\ }
695   \bitbox{2}{\tt 10}
696   \bitbox{6}{\tt Literal} 
697 \end{bytefield}
698
699 \begin{bytefield}{26}
700   \bitheader[b]{0,5,6,7}\\
701   \bitbox[r]{18}{\raggedleft with $\infty$\ \ }
702   \bitbox{2}{\tt 11} 
703 \color{light}
704   \bitbox[tbr]{6}{} 
705 \color{black}
706 \end{bytefield}
707
708
709 \subsection{{\tt setOuter}}
710
711 This instruction loads the outer loop counter {\tt OLC} with either
712 {\tt max(0,OLC-1)}, a literal or the contents of the {\tt data}
713 register.
714
715 \setlength{\bitwidth}{5mm}
716 {\tt
717 \begin{bytefield}{26}
718   \bitheader[b]{16-19,21,24}\\
719 \color{light}
720   \bitbox{1}{I}
721   \bitbox{1}{OS}
722 \color{light}
723   \bitbox[tbr]{2}{P}
724 \color{black}
725   \bitbox{3}{000}
726   \bitbox{1}{1}
727   \bitbox{2}{10}
728 \color{light}
729   \bitbox[tbr]{9}{} 
730   \bitbox[l]{7}{}
731 \color{black}
732 \end{bytefield}}\\
733
734 \begin{bytefield}{26}
735   \bitbox[r]{19}{\raggedleft {\tt max(0,OLC-1)}:\hspace{0.2cm}\ }
736   \bitbox{2}{\tt 00} 
737 %\color{light}
738   \bitbox[tbr]{5}{} 
739 %\color{black}
740 \color{black}
741 \end{bytefield}
742
743 \begin{bytefield}{26}
744   \bitbox[r]{19}{\raggedleft from data latch:\hspace{0.2cm}\ }
745   \bitbox{2}{\tt 01} 
746 \color{light}
747   \bitbox[tbr]{5}{} 
748 \color{black}
749 \end{bytefield}
750
751 \begin{bytefield}{26}
752   \bitheader[b]{0,5,6}\\
753   \bitbox[r]{19}{\raggedleft from literal:\hspace{0.2cm}\ }
754   \bitbox{1}{\tt 1} 
755   \bitbox{6}{\tt Literal} 
756 \end{bytefield}
757
758
759 %\subsection{{\tt torpedo}}
760 %
761 %\setlength{\bitwidth}{5mm}
762 %{\tt
763 %\begin{bytefield}{26}
764 %  \bitheader[b]{0,5,16-19,21}\\
765 %\color{light}
766 %  \bitbox{4}{} 
767 %\color{black}
768 %  \bitbox{3}{000} 
769 %  \bitbox{1}{1}
770 %  \bitbox{2}{00}
771 %\color{light}
772 %  \bitbox[tbr]{16}{} 
773 %\end{bytefield}}
774 %
775 %
776 %When a {\tt torpedo} instruction reaches the instruction horn, it will
777 %wait there until an instruction is on deck whose {\tt A}rmor bit is
778 %not set.  The {\tt torpedo} will then cause ``Process \#2'' of the on
779 %deck instruction to terminate and will set the outer loop counter to zero.
780
781 \subsection{{\tt tail}}
782
783 \color{red}
784 {\it This will probably become a bit on every instruction rather than
785   its own instruction.  The only problem is that we have run out of bits in the {\tt literal} instruction.  Two possible solutions: (a) declare that {\tt literal} cannot be the last instruction in a loop or (b) because {\tt literal} instructions cannot be torpedoed anyways, re-use its {\tt I} bit for this purpose.}
786 \color{black}
787
788 \setlength{\bitwidth}{5mm}
789 {\tt
790 \begin{bytefield}{26}
791   \bitheader[b]{0,5,16-19,21}\\
792 \color{light}
793   \bitbox{4}{} 
794 \color{black}
795   \bitbox{3}{000} 
796   \bitbox{1}{1}
797   \bitbox{2}{01}
798 \color{light}
799   \bitbox[tbr]{16}{} 
800 \end{bytefield}}
801
802 When a {\tt tail} instruction reaches {\tt IH}, it seals the hatch.
803 The {\tt tail} instruction does not enter the instruction fifo.
804
805 \color{black}
806 %\pagebreak
807 %\subsection{{\tt takeOuterLoopCounter}}
808 %
809 %\setlength{\bitwidth}{5mm}
810 %{\tt
811 %\begin{bytefield}{26}
812 %  \bitheader[b]{16-19,21}\\
813 %\color{light}
814 %  \bitbox{1}{A}
815 %  \bitbox{1}{OS} 
816 %  \bitbox{2}{P}
817 %\color{black}
818 %  \bitbox{3}{000}
819 %  \bitbox{1}{0}
820 %  \bitbox{2}{11}
821 %\color{light}
822 %  \bitbox[tbr]{16}{} 
823 %\color{black}
824 %\end{bytefield}}
825 %
826 %This instruction copies the value in the outer loop counter {\tt OLC}
827 %into the least significant bits of the data latch and leaves all other
828 %bits of the data latch unchanged.
829 %
830 %\subsection{{\tt takeInnerLoopCounter}}
831 %
832 %\setlength{\bitwidth}{5mm}
833 %{\tt
834 %\begin{bytefield}{26}
835 %  \bitheader[b]{16-19,21}\\
836 %\color{light}
837 %  \bitbox{1}{A}
838 %  \bitbox{1}{OS} 
839 %  \bitbox{2}{P}
840 %\color{black}
841 %  \bitbox{3}{???}
842 %  \bitbox{1}{?}
843 %  \bitbox{2}{??}
844 %\color{light}
845 %  \bitbox[tbr]{16}{} 
846 %\color{black}
847 %\end{bytefield}}
848 %
849 %This instruction copies the value in the inner loop counter {\tt ILC}
850 %into the least significant bits of the data latch and leaves all other
851 %bits of the data latch unchanged.
852 %
853 %
854 %
855 %%\pagebreak
856 %%\subsection{{\tt interrupt}}
857 %%
858 %%\setlength{\bitwidth}{5mm}
859 %{\tt
860 %\begin{bytefield}{26}
861 %  \bitheader[b]{0,5,16-19,21}\\
862 %\color{light}
863 %  \bitbox{4}{} 
864 %\color{black}
865 %  \bitbox{3}{000} 
866 %  \bitbox{1}{1}
867 %  \bitbox{2}{00}
868 %\color{light}
869 %  \bitbox[tbr]{16}{} 
870 %\end{bytefield}}
871 %
872 %When an {\tt interrupt} instruction reaches {\tt IH}, it will wait
873 %there for the {\tt OD} stage to be full with an instruction that has
874 %the {\tt IM} bit set.  When this occurs, the instruction at {\tt OD}
875 %{\it will not execute}, but {\it may reloop} if the conditions for
876 %relooping are met.
877 %\footnote{The ability to interrupt an instruction yet have it reloop is very
878 %useful for processing chunks of data with a fixed size header and/or
879 %footer and a variable length body.}
880 %
881 %
882 %\subsection{{\tt massacre}}
883 %
884 %\setlength{\bitwidth}{5mm}
885 %{\tt
886 %\begin{bytefield}{26}
887 %  \bitheader[b]{16-19,21}\\
888 %\color{light}
889 %  \bitbox{4}{} 
890 %\color{black}
891 %  \bitbox{3}{000} 
892 %  \bitbox{1}{1}
893 %  \bitbox{2}{01}
894 %\color{light}
895 %  \bitbox[tbr]{16}{} 
896 %\color{black}
897 %\end{bytefield}}
898 %
899 %When a {\tt massacre} instruction reaches {\tt IH}, it will wait there
900 %for the {\tt OD} stage to be full with an instruction that has the
901 %{\tt IM} bit set.  When this occurs, all instructions in the
902 %instruction fifo (including {\tt OD}) are retired.
903 %
904 %\subsection{{\tt clog}}
905 %
906 %\setlength{\bitwidth}{5mm}
907 %{\tt
908 %\begin{bytefield}{26}
909 %  \bitheader[b]{16-19,21}\\
910 %\color{light}
911 %  \bitbox{4}{} 
912 %\color{black}
913 %  \bitbox{3}{000} 
914 %  \bitbox{1}{1}
915 %  \bitbox{2}{10}
916 %\color{light}
917 %  \bitbox[tbr]{16}{} 
918 %\color{black}
919 %\end{bytefield}}
920 %
921 %When a {\tt clog} instruction reaches {\tt OD}, it remains there and
922 %no more instructions will be executed until an {\tt unclog} is
923 %performed.
924 %
925 %\subsection{{\tt unclog}}
926 %
927 %\setlength{\bitwidth}{5mm}
928 %{\tt
929 %\begin{bytefield}{26}
930 %  \bitheader[b]{16-19,21}\\
931 %\color{light}
932 %  \bitbox{4}{} 
933 %\color{black}
934 %  \bitbox{3}{000} 
935 %  \bitbox{1}{1}
936 %  \bitbox[lrtb]{2}{11}
937 %\color{light}
938 %  \bitbox[tbr]{16}{} 
939 %\color{black}
940 %\end{bytefield}}
941 %
942 %When an {\tt unclog} instruction reaches {\tt IH}, it will wait there
943 %until a {\tt clog} instruction is at {\tt OD}.  When this occurs, both
944 %instructions retire.
945 %
946 %Note that issuing an {\tt unclog} instruction to a dock which is not
947 %clogged and whose instruction fifo contains no {\tt clog} instructions
948 %will cause the dock to deadlock.
949
950
951
952 \pagebreak
953 \epsfig{file=overview,height=5in,angle=90}
954
955 \pagebreak
956 \subsection*{Input Dock}
957 \epsfig{file=indock,width=7in,angle=90}
958
959 \pagebreak
960 \subsection*{Output Dock}
961 \epsfig{file=outdock,width=6.5in,angle=90}
962
963
964 %\pagebreak
965 %\epsfig{file=ports,height=5in,angle=90}
966
967 %\pagebreak
968 %\epsfig{file=best,height=5in,angle=90}
969
970
971 \end{document}