update to 17-Feb
[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 \setlength{\marginparwidth}{1.2in}
24 \let\oldmarginpar\marginpar
25 \renewcommand\marginpar[1]{\-\oldmarginpar[\raggedleft\footnotesize #1]%
26 {\raggedright\footnotesize #1}}
27
28
29 \newcommand{\footnoteremember}[2]{
30   \footnote{#2}
31   \newcounter{#1}
32   \setcounter{#1}{\value{footnote}}
33 } \newcommand{\footnoterecall}[1]{
34   \footnotemark[\value{#1}]
35 }
36
37 %\pdfpagewidth 8.5in
38 %\pdfpageheight 11in 
39 %\topmargin 0in
40 \textheight 8.2in
41 %\textwidth 6.0in
42 %\oddsidemargin 0.25in
43 %\evensidemargin 0.25in
44 %\headwidth 6.0in
45 \def\to{\ $\rightarrow$\ }
46
47 \def\docnum{AM33}
48
49 \author{
50 \normalsize{
51 \begin{tabular}{c}
52 \end{tabular}}
53 }
54
55 \title{\vspace{-1cm}AM33: The FleetTwo Dock
56 \\
57 {\normalsize
58 Adam Megacz
59 }}
60
61 \begin{document}
62
63 \maketitle
64
65 \begin{abstract}
66 Changes:
67
68 \begin{tabular}{rl}
69 \color{red}17-Feb\color{black}
70 & \color{red} Clarified setting of the {\tt C}-flag\color{black}\\
71 05-Jan
72 & Fixed a one-word typo \\
73 02-Jan
74 & Added {\tt head} instruction \\
75 & Lengthened external encoding of {\tt tail} instruction by one bit \\
76 & Added {\tt abort} instruction \\
77 & Removed {\tt OS} field from instructions \\
78 & Renamed the {\tt Z}-flag (olc {\bf Z}ero) to the {\tt D}-flag (loop {\bf D}one)\\
79 19-Dec
80 & Updated diagram in section 3 to put dispatch path near MSB\\
81 & Changed DP[37:25] to DP[37:27]\\
82 & Added note on page 4 regarding previous\\
83 14-Nov
84 & Roll back ``Distinguish {\tt Z}-flag from OLC=0'' \\
85 & Clarify what ``{\tt X-Extended}'' means \\
86 & Change C-bit source selector from {\tt Di} to {\tt Dc} \\
87 07-Nov
88 & Distinguish {\tt Z}-flag from OLC=0\\
89 & Add {\tt flush} instruction\\
90 & Change {\t I} bit from ``Interruptable'' to ``Immune''\\
91 20-Sep
92 & Update hatch description to match \href{http://fleet.cs.berkeley.edu/docs/people/ivan.e.sutherland/ies50-Requeue.State.Diagram.pdf}{IES50} \\
93 28-Aug
94 & Note that decision to requeue is based on  value of OLC {\it before} execution\\
95 & Note that decision to open the hatch is based on value of {\tt OS} bit\\
96 %10-Jul
97 %& Added {\tt OLC=0} predicate \\
98 %& Eliminated {\tt TAPL} (made possible by previous change) \\
99 %& Expanded {\tt set} {\tt Immediate} field from 13 bits to 14 bits (made possible by previous change)\\
100 %09-Jul
101 %& Fixed a few typos \\
102 %& Added {\tt DataLatch}\to{\tt TAPL} (Amir's request) \\
103 %& Eliminate ability to predicate directly on {\tt C}-flag (Ivan's request) \\
104 %16-Jun
105 %& When a torpedo strikes, {\tt ILC} is set to {\tt 1} \\
106 %& Only {\tt move} can be torpedoed (removed {\tt I}-bit from {\tt set}/{\tt shift}) \\
107 %11-Jun
108 %& Changed all uses of ``Payload'' to ``Immediate'' \color{black} (not in red) \\
109 %& Reworked encoding of {\tt set} instruction \\
110 %\color{black} 
111 %06-Jun
112 %& Factored in Russell Kao's comments (thanks!)\\
113 %& Added mechanism for setting C-flag from fabric even on outboxes\\
114 %05-Jun
115 %& Made {\tt OLC} test a predicate-controlled condition\\
116 %& Rewrote ``on deck'' section \\
117 %& Added ``{\tt unset}'' value for {\tt ILC}\\
118 %& Changed {\tt DP} to {\tt DataPredecessor} for clarity\\
119 %\color{black}
120 %30-Apr
121 %& added comment about address-to-path ship \\
122 %& changed {\tt DST} field of {\tt set} instruction from 2 bits to 3 \\
123 %& changed the order of instructions in the encoding map \\
124 %23-Apr
125 %& added epilogue fifo to diagrams \\
126 %& indicated that a token sent to the instruction port is treated as a torpedo \\
127 %18-Apr
128 %& replaced {\tt setInner}, {\tt setOuter}, {\tt setFlags} with unified {\tt set} instruction \\
129 %& replaced {\tt literal} with {\tt shift} instruction \\
130 %17-Apr
131 %& Made all instructions except {\tt setOuter} depend on {\tt OLC>0}  \\
132 %& Removed ability to manually set the {\tt C} flag  \\
133 %& Expanded predicate field to three bits \\
134 %& New literals scheme (via shifting) \\
135 %& Instruction encoding changes made at Ivan's request (for layout purposes) \\
136 %& Added summary of instruction encodings on last page \\
137 %07-Apr
138 %& removed ``+'' from ``potentially torpedoable'' row where it does not occur in Execute  \\
139 %06-Apr
140 %& extended {\tt LiteralPath} to 13 bits (impl need not use all of them)  \\
141 %& update table 3.1.2  \\
142 %& rename {\tt S} flag to {\tt C}  \\
143 %& noted that {\tt setFlags} can be used as {\tt nop} \\
144 %29-Mar
145 %& removed the {\tt L} flag (epilogues can now do this) \\
146 %& removed {\tt take\{Inner|Outer\}LoopCounter} instructions \\
147 %& renamed {\tt data} instruction to {\tt literal} \\
148 %& renamed {\tt send} instruction to {\tt move} \\
149 %23-Mar
150 %& added ``if its predicate is true'' to repeat count \\
151 %& added note that red wires do not contact ships \\
152 %& changed name of {\tt flags} instruction to {\tt setFlags} \\
153 %& removed black dot from diagrams \\
154 %& changed {\tt OL} (Outer Loop participant) to {\tt OS} (One Shot) and inverted polarity \\
155 %& indicated that the death of the {\tt tail} instruction is what causes the hatch to be unsealed \\
156 %& indicated that only {\tt send} instructions which wait for data are torpedoable \\
157 %& added section ``Torpedo Details'' \\
158 %& removed {\tt torpedo} instruction \\
159 %12-Mar
160 %\color{black}
161 %& renamed loop+repeat to outer+inner (not in red) \\
162 %& renamed {\tt Z} flag to {\tt L} flag (not in red) \\
163 %& rewrote ``inner and outer loops'' section \\
164 %& updated all diagrams \\
165 %\color{black}
166 %7-Mar
167 %& Moved address bits to the LSB-side of a 37-bit instruction \\
168 %& Added {\it micro-instruction} and {\it composite instruction} terms \\
169 %& Removed the {\tt DL} field, added {\tt decrement} mode to {\tt loop} \\
170 %& Created the {\tt Hold} field \\
171 %& Changed how ReLooping works \\
172 %& Removed {\tt clog}, {\tt unclog}, {\tt interrupt}, and {\tt massacre} \\
173 \end{tabular}
174 \end{abstract}
175
176 \vfill
177
178 \begin{center}
179 \epsfig{file=all,height=1.5in}
180 \epsfig{file=overview-new,height=1.5in}
181 \end{center}
182
183 \pagebreak
184
185 \section{Overview of Fleet}
186
187 A Fleet processor is organized around a {\it switch fabric}, which is
188 a packet-switched network with reliable in-order delivery.  The switch
189 fabric is used to carry data between different functional units,
190 called {\it ships}.  Each ship is connected to the switch fabric by
191 one or more programmable elements known as {\it docks}.
192
193 A {\it path} specifies a route through the switch fabric from a
194 particular {\it source} to a particular {\it destination}.  The
195 combination of a path and a single word to be delivered is called a
196 {\it packet}.  The switch fabric carries packets from their sources to
197 their destinations.  Each dock has two destinations: one for {\it
198   instructions} and one for {\it data}.  A Fleet is programmed by
199 depositing instruction packets into the switch fabric with paths that
200 will lead them to instruction destinations of the docks at which they
201 are to execute.
202
203 When a packet arrives at the instruction destination of a dock, it is
204 enqueued for execution.  Before the instruction executes, it may cause
205 the dock to wait for a packet to arrive at the dock's data destination
206 or for a value to be presented by the ship.  When an instruction
207 executes it may consume this data and may present a data value to the
208 ship or transmit a packet.
209
210 When an instruction sends a packet into the switch fabric, it may
211 specify that the payload of the packet is irrelevant.  Such packets
212 are known as {\it tokens}, and consume less energy than data packets.
213
214
215 \begin{center}
216 \epsfig{file=overview-new,width=2.5in}\\
217 {\it Overview of a Fleet processor; dark gray shading represents the
218   switch fabric, ships are shown in light gray, and docks are shown in blue.}
219 \end{center}
220 \color{black}
221
222 \pagebreak
223
224 \section{The FleetTwo Dock}
225
226 The diagram below represents a conceptual view of the interface
227 between ships and the switch fabric; actual implementation circuitry
228 may differ.
229
230 \begin{center}
231 \epsfig{file=all,width=3.5in}\\
232 {\it An ``input'' dock and ``output'' dock connected to a ship.  Solid
233   blue lines carry either tokens or data words, red lines carry either
234   instructions or torpedoes, and dashed lines carry only tokens.}
235 \end{center}
236
237 Each dock consists of a {\it data latch}, which is as wide as a single
238 machine word and a circular {\it instruction fifo} of
239 instruction-width latches.  The values in the instruction fifo control
240 the data latch.  The dock also includes a {\it path latch}, which
241 stores the path along which outgoing packets will be
242 sent.\color{black}
243
244 Note that the instruction fifo in each dock has a destination of its
245 own; this is the {\it instruction destination} mentioned in the
246 previous section.  A token sent to an instruction destination is
247 called a {\it torpedo}; it does not enter the instruction fifo, but
248 rather is held in a waiting area where it may interrupt certain
249 instructions (see the section on the {\tt move} instruction for further
250 details).
251
252 From any source to any dock's data destination there are
253 two distinct paths which differ by a single bit.  This bit is known as
254 the ``signal'' bit, and the routing of a packet is not affected by it;
255 the signal bit is used to pass control values between docks.  Note that paths
256 terminating at an {\it instruction} destination need not have a signal
257 bit.  \color{black}
258
259 \pagebreak
260 \section{Instructions}
261
262 In order to cause an instruction to execute, the programmer must first
263 arrange for that instruction word to arrive in the data latch of some
264 output dock.  For example, this might be the ``data read'' output dock
265 of the memory access ship or the output of a fifo ship.  Once an
266 instruction has arrived at this output dock, it is {\it dispatched} by
267 sending it to the {\it instruction destination} of the dock at which
268 it is to execute.
269
270 Each instruction is 26 bits long, which makes it possible for an
271 instruction and an 11-bit path to fit in a single word of memory.
272 This path is the path from the {\it dispatching} dock to the {\it
273   executing} dock.
274
275 \vspace{0.5cm}
276
277 \setlength{\bitwidth}{3.5mm}
278 {\tt \footnotesize
279 \begin{bytefield}{37}
280   \bitheader[b]{0,25,26,36}\\
281   \bitbox{11}{dispatch path} 
282   \bitbox{26}{instruction} 
283 \end{bytefield}}
284 \color{black}
285
286 Note that the 11 bit {\tt dispatch path} field is not the same width
287 as the 13 bit {\tt Immediate} path field in the {\tt move} instruction,
288 which in turn may not be the same width as the actual path latches in
289 the switch fabric.
290
291 The algorithm for expanding a path to a wider width is specific to the
292 switch fabric implementation, and is not specified by this
293 document.\footnote{for the Marina experiment, the correct
294   algorithm is to sign-extend the path; the most significant bit of
295   the given path is used to fill all vacant bits of the latch} In
296 particular, because the {\tt dispatch path} field is always used to
297 specify a path which terminates at an instruction destination (never a
298 data destination), and because instruction destinations ignore the
299 signal bit, certain optimizations may be possible.  \color{black}
300
301
302 %\subsection{Life Cycle of an Instruction}
303 %
304 %The diagram below shows an input dock for purposes of illustration:
305 %
306 %\begin{center}
307 %\epsfig{file=in,width=4in}\\
308 %{\it an input dock}
309 %\end{center}
310 %
311 %\color{black}
312 %
313 %\begin{center}
314 %\epsfig{file=out,width=4in}\\
315 %{\it an output dock}
316 %\end{center}
317
318 %\subsection{Format of an Instruction}
319 %
320 %All instruction words have the following format:
321 %
322 \newcommand{\bitsHeader}{
323   \bitbox{1}{I} 
324   \bitbox{1}{}
325   \bitbox{3}{P} 
326 }
327 \newcommand{\bitsHeaderNoI}{
328   \bitbox{2}{} 
329   \bitbox{3}{P} 
330 }
331 %
332 %
333 %The {\tt P} bits are a {\it predicate}; this holds a code which
334 %indicates if the instruction should be executed or ignored depending
335 %on the state of flags in the dock.  Note that {\tt head} and {\tt
336 %tail} instructions do not have {\tt P} fields.
337
338
339 \subsection{Loop Counters}
340
341 A programmer can perform two types of loops: {\it inner} loops
342 consisting of only one {\tt move} instruction and {\it outer} loops of
343 multiple instructions of any type.  Inner loops may be nested within
344 an outer loop, but no other nesting of loops is allowed.
345
346 The dock has two loop counters, one for each kind of loop:
347
348 \begin{itemize}
349 \item {\tt OLC} is the Outer Loop Counter
350 \item {\tt ILC} is the Inner Loop Counter
351 \end{itemize}
352
353 The {\tt OLC} applies to all instructions and can hold integers {\tt
354   0..MAX_OLC}.
355
356 The {\tt ILC} applies only to {\tt move} instructions and can hold
357 integers {\tt 0..MAX_ILC} as well as a special value: $\infty$.  When
358 {\tt ILC=0} the next {\tt move} instruction executes zero times (ie is
359 ignored).  When {\tt ILC=$\infty$} the next {\tt move} instruction
360 executes until interrupted by a torpedo.  After every {\tt move}
361 instruction the {\tt ILC} is reset to {\tt 1} (note that it is reset
362 to {\tt 1}, {\it not to 0}).
363
364 \color{black}
365 \subsection{Flags}
366
367 The dock has four flags: {\tt A}, {\tt B},
368 {\tt C}, and {\tt D}.
369
370 \begin{itemize}
371 \item The {\tt A} and {\tt B} flags are general-purpose flags which
372       may be set and cleared by the programmer.
373
374 %\item
375 %
376 % The {\tt L} flag, known as the {\it last} flag, is set whenever
377 %      the value in the outer counter ({\tt OLC}) is one,
378 \color{black}
379 % indicating
380 %      that the dock is in the midst of the last iteration of an
381 %      outer loop.  This flag can be used to perform certain
382 %      operations (such as sending a completion token) only on the last
383 %      iteration of an outer loop.
384
385 \item The {\tt C} flag is known as the {\it control} flag, and may be
386       set by the {\tt move} instruction based on information from the
387       ship or from an inbound packet.  See the {\tt move} instruction
388       for further details.
389
390 \item The {\tt D} flag is known as the {\it done} flag.  The {\tt D}
391       flag is {\it set} when the {\tt OLC} is zero immediately after
392       execution of a {\tt set olc} or {\tt decrement olc} instruction,
393       or when a torpedo strikes.  The {\tt D} flag is {\it cleared}
394       when a {\tt set olc} instruction causes the {\tt OLC} to be
395       loaded with a nonzero value.
396
397 \color{black}
398
399 \end{itemize}
400
401 \subsection{Predication}
402
403 All instructions except for {\tt head} and {\tt tail} have a three-bit
404 field marked {\tt P}, which specifies a {\it predicate}.
405
406 \begin{center}
407 \setlength{\bitwidth}{5mm}
408 {\tt{\footnotesize{
409 \begin{bytefield}{26}
410   \bitheader[b]{0,20,21,23-25}\\
411   \bitsHeaderNoI
412   \bitbox[tbr]{21}{} 
413 \color{black}
414 \end{bytefield}}}}
415 \end{center}
416
417 The predicate determines which conditions must be true in order for
418 the instruction to execute; if it is not executed, it is simply {\it
419   ignored}.  The table below shows what conditions must be true in
420 order for an instruction to execute:
421
422 \begin{center}
423 \begin{tabular}{|r|l|}\hline
424 Code       & Execute if \\\hline
425 {\tt 000:} & {\tt D=0}\   and {\tt A=0} \\
426 {\tt 001:} & {\tt D=0}\   and {\tt A=1} \\
427 {\tt 010:} & {\tt D=0}\   and {\tt B=0} \\
428 {\tt 011:} & {\tt D=0}\   and {\tt B=1} \\
429 {\tt 100:} & Unused  \\
430 {\tt 101:} & {\tt D=1}\   \\
431 {\tt 110:} & {\tt D=0}\   \\
432 {\tt 111:} & always  \\
433 \hline\end{tabular}
434 \end{center}
435
436 \pagebreak
437
438 \begin{wrapfigure}{r}{40mm}
439   \begin{center}
440 \epsfig{file=requeue,height=1.5in}\\
441   \end{center}
442   \caption{{\it the requeue stage}}
443 \end{wrapfigure}
444
445 \subsection{The Requeue Stage}
446
447 The requeue stage has two inputs, which will be referred to as the
448 {\it enqueueing} input and the {\it recirculating} input.  It has a
449 single output which feeds into the instruction fifo.
450
451 The requeue stage has two states: {\sc Updating} and {\sc
452   Circulating}.
453
454 \subsubsection{The {\sc Updating} State}
455
456 On initialization, the dock is in the {\sc Updating} state.  In this
457 state the requeue stage is performing three tasks:
458 \begin{itemize}
459 \item it is draining the
460 previous loop's instructions (if any) from the fifo
461 \item it is executing any ``one
462 shot'' instructions which come between the previous loop's {\tt tail}
463 and the next loop's {\tt head}
464 \item it is loading the instructions of
465 the next loop into the fifo.
466 \end{itemize}
467
468 In the {\sc Updating} state, the requeue stage will accept any
469 instruction other than a {\tt tail} which arrives at its {\it
470   enqueueing} input, and pass this instruction to its output.  Any
471 instruction other than a {\tt head} which arrives at the {\it
472   recirculating} input will be discarded.
473
474 Note that when a {\tt tail} instruction arrives at the {\it
475   enqueueing} input, it ``gets stuck'' there.  Likewise, when a {\tt
476   head} instruction arrives at the {\it recirculating} input, it also
477 ``gets stuck''.  When the requeue stage finds {\it both} a {\tt tail}
478 instruction stuck at the {\it enqueueing} input and a {\tt head}
479 instruction stuck at the {\it recirculating} input, the requeue stage
480 discards both the {\tt head} and {\tt tail} and transitions to the
481 {\sc Circulating} state.
482
483 \subsubsection{The {\sc Circulating} State}
484
485 In the {\sc Circulating} state, the dock repeatedly executes the set
486 of instructions that are in the instruction fifo.
487
488 In the {\sc Circulating} state, the requeue stage will not accept
489 items from its {\it enqueueing} input.  Any item presented at the {\it
490   recirculating} input will be passed through to the requeue stage's
491 output.
492
493 When an {\tt abort} instruction is executed, the requeue stage
494 transitions back to the {\sc Updating} state.  Note that {\tt abort}
495 instructions include a predicate; an {\tt abort} instruction whose
496 predicate is not met will not cause this transition.
497
498 \color{black}
499
500
501 \pagebreak
502 \section{Instructions}
503
504 %The dock supports four instructions:
505 %{\tt move} (variants: {\tt moveto}, {\tt dispatch}),
506 %{\tt shift},
507 %{\tt set}, and
508 %{\tt tail}.
509 %\color{black}
510
511
512 \subsection{{\tt move}}
513
514 \newcommand{\bitsMove}{\setlength{\bitwidth}{5mm}
515 {\tt
516 \begin{bytefield}{26}
517   \bitheader[b]{14-20}\\
518 \color{light}
519   \bitsHeader
520 \color{black}
521   \bitbox{1}{0} 
522   \bitbox{1}{1} 
523   \bitbox{1}{\tt Ti}
524   \bitbox{1}{\tt Di}
525   \bitbox{1}{\tt Dc}
526   \bitbox{1}{\tt Do}
527   \bitbox{1}{\tt To}
528   \bitbox[l]{19}{}
529 \end{bytefield}}
530
531 \begin{bytefield}{26}
532   \bitheader[b]{0,12,13}\\
533   \bitbox[1]{11}{\raggedleft {\tt moveto} ({\tt Immediate\to Path})}
534   \bitbox[r]{1}{}
535   \bitbox{1}{\tt 1}
536   \bitbox{13}{\tt Immediate}
537 \end{bytefield}
538
539 \begin{bytefield}{26}
540   \bitheader[b]{11,12,13}\\
541   \bitbox[1]{11}{\raggedleft {\tt dispatch} ({\footnotesize {\tt DataPredecessor[37:27\color{black}]\to Path}})\ \ }
542   \bitbox[r]{1}{}
543   \bitbox{1}{\tt 0}
544   \bitbox{1}{\tt 1}
545 \color{light}
546   \bitbox[trb]{12}{}
547 \color{black}
548 \end{bytefield}
549
550 \begin{bytefield}{26}
551   \bitheader[b]{11,12,13}\\
552   \bitbox[1]{11}{\raggedleft {\tt move} ({\tt Path} unchanged):}
553   \bitbox[r]{1}{}
554   \bitbox{1}{\tt 0}
555   \bitbox{1}{\tt 0}
556 \color{light}
557   \bitbox[trb]{12}{}
558 \color{black}
559 \end{bytefield}}
560 \bitsMove
561
562 \begin{itemize}
563 \item {\tt Ti} - Token Input: wait for the token predecessor to be full and drain it.
564 \item {\tt Di} - Data Input: wait for the data predecessor to be full and drain it.
565 \item {\tt Dc} - Data Capture: pulse the data latch.
566 \item {\tt Do} - Data Output: fill the data successor.
567 \item {\tt To} - Token Output: fill the token successor.
568 \end{itemize}
569
570 The data successor and token successor must both be empty in order for
571 a {\tt move} instruction to attempt execution.
572
573 The {\tt I} bit stands for {\tt Immune}, and indicates if the
574 instruction is immune to torpedoes.
575
576 Every time the {\tt move} instruction executes, the {\tt C} flag may
577 be set:
578
579 \color{red}
580 \begin{itemize}
581 \item At an {\it input} dock the {\tt C} flag is set to the signal bit
582       of the incoming packet if {\tt Dc} bit is set.  If the {\tt Dc}
583       bit is not set the {\tt C} flag takes an unknown value.
584
585 \item At an {\it output} dock the {\tt C} flag is set to a value
586       provided by the ship if the {\tt Dc} bit is set.  If the {\tt
587       Dc} bit is not set, the {\tt C} flag is set to the signal bit of
588       the incoming packet.
589 \end{itemize}
590 \color{black}
591
592 The {\tt flush} instruction is a variant of {\tt move} which is valid
593 only at input docks.  It has the same effect as {\tt deliver}, except
594 that it sets a special ``flushing'' indicator along with the data
595 being delivered.
596
597 \newcommand{\bitsFlush}{\setlength{\bitwidth}{5mm}
598 {\tt
599 \begin{bytefield}{26}
600   \bitheader[b]{14-18}\\
601   \bitbox[r]{7}{\raggedleft{\tt flush\ \ }}
602   \bitbox{1}{\tt 0}
603 \color{black}
604   \bitbox{1}{\tt 0}
605   \bitbox{1}{\tt 1}
606 \color{light}
607   \bitbox{1}{\tt 0}
608   \bitbox{1}{\tt 0}
609   \bitbox{14}{}
610 \end{bytefield}}}
611 \bitsFlush
612
613 When a ship fires, it must examine the ``flushing'' indicators on the
614 input docks whose fullness was part of the firing condition.  If all
615 of the input docks' flushing indicators are set, the ship must drain
616 all of their data successors and take no action.  If some, but not
617 all, of the indicators are set, the ship must drain {\it only the data
618   successors of the docks whose indicators were {\bf not} set}, and
619 take no action.  If none of the flushing indicators was set, the ship
620 fires normally.
621
622 \color{black}
623
624 \pagebreak
625
626 \subsection{{\tt set}}
627
628 The {\tt set} command is used to set or decrement the inner loop
629 counter, outer loop counter, and data latch.
630
631 \newcommand{\bitsSet}{
632 {\tt
633 \begin{bytefield}{26}
634   \bitheader[b]{19-25}\\
635   \bitsHeaderNoI
636   \bitbox{1}{1}
637   \bitbox{1}{0} 
638 \color{light}
639   \bitbox{4}{Dest} 
640   \bitbox{3}{Src} 
641   \bitbox{12}{} 
642 \color{black}
643 \end{bytefield}}
644
645 \begin{bytefield}{26}
646   \bitheader[b]{0,5,12-18}\\
647   \bitbox[1]{6}{\raggedleft {\tt Immediate}\to{\tt OLC}}
648   \bitbox[r]{1}{}
649   \bitbox{4}{\tt 1000\color{black}}
650   \bitbox{3}{\tt 100}
651   \bitbox{6}{}
652   \bitbox{6}{\tt Immediate}
653 \end{bytefield}
654
655 \begin{bytefield}{26}
656   \bitheader[b]{12-18}\\
657   \bitbox[1]{6}{\raggedleft {\tt Data Latch}\to{\tt OLC}}
658   \bitbox[r]{1}{}
659   \bitbox{4}{\tt 1000\color{black}}
660   \bitbox{3}{\tt 010}
661   \bitbox{12}{}
662 \end{bytefield}
663
664 \begin{bytefield}{26}
665   \bitheader[b]{12-18}\\
666   \bitbox[1]{6}{\raggedleft {\tt OLC-1}\to{\tt OLC}}
667   \bitbox[r]{1}{}
668   \bitbox{4}{\tt 1000\color{black}}
669   \bitbox{3}{\tt 001}
670   \bitbox{12}{}
671 \end{bytefield}
672
673 \begin{bytefield}{26}
674   \bitheader[b]{0,5,6,12-18}\\
675   \bitbox[1]{6}{\raggedleft {\tt Immediate}\to{\tt ILC}}
676   \bitbox[r]{1}{}
677   \bitbox{4}{\tt 0100\color{black}}
678   \bitbox{3}{\tt 100}
679   \bitbox{5}{}
680   \bitbox{1}{\tt 0}
681   \bitbox{6}{\tt Immediate}
682 \end{bytefield}
683
684 \begin{bytefield}{26}
685   \bitheader[b]{6,12-18}\\
686   \bitbox[1]{6}{\raggedleft $\infty$\to{\tt ILC}}
687   \bitbox[r]{1}{}
688   \bitbox{4}{\tt 0100\color{black}}
689   \bitbox{3}{\tt 100}
690   \bitbox{5}{}
691   \bitbox{1}{\tt 1}
692   \bitbox{6}{}
693 \end{bytefield}
694
695 \begin{bytefield}{26}
696   \bitheader[b]{12-18}\\
697   \bitbox[1]{6}{\raggedleft {\tt Data Latch}\to{\tt ILC}}
698   \bitbox[r]{1}{}
699   \bitbox{4}{\tt 0100\color{black}}
700   \bitbox{3}{\tt 010}
701   \bitbox{12}{}
702 \end{bytefield}
703
704 \begin{bytefield}{26}
705   \bitheader[b]{0,13-18}\\
706   \bitbox[1]{6}{\raggedleft \footnotesize {\tt Sign-Extended Immediate}\to{\tt Data Latch}}
707   \bitbox[r]{1}{}
708   \bitbox{4}{\tt 0010\color{black}}
709   \bitbox{1}{\begin{minipage}{0.5cm}{
710 \begin{center}
711 \tt{\footnotesize{Si
712
713 \vspace{-2mm}gn}}
714 \end{center}}
715 \end{minipage}}
716   \bitbox{14}{\tt Immediate}
717 \end{bytefield}
718
719 \begin{bytefield}{26}
720   \bitheader[b]{0,5,6,11,15-18}\\
721   \bitbox[1]{6}{\raggedleft {\tt Update Flags}}
722   \bitbox[r]{1}{}
723   \bitbox{4}{\tt 0001\color{black}}
724   \bitbox{3}{}
725   \bitbox{6}{\tt nextA}
726   \bitbox{6}{\tt nextB}
727 \end{bytefield}
728 \color{black}
729 }
730 \bitsSet
731
732 The FleetTwo implementation is likely to have an unarchitected
733 ``literal latch'' at the on deck ({\tt OD}) stage, which is loaded
734 with the possibly-extended literal {\it at the time that the {\tt set}
735   instruction comes on deck}.  This latch is then copied into the data
736 latch when a {\tt set Data Latch} instruction
737 executes.
738
739 The {\tt Sign-Extended Immediate} instruction copies the {\tt
740 Immediate} field into the least significant bits of the data latch.
741 All other bits of the data latch are filled with a copy of the
742 bit marked ``{\tt Sign}.''
743 \color{black}
744
745 Each of the {\tt nextA} and {\tt nextB} fields has the following
746 structure, and indicates which old flag values should be logically
747 {\tt OR}ed together to produce the new flag value:
748
749 \begin{center}
750 {\tt
751 \begin{bytefield}{6}
752   \bitheader[b]{0-5}\\
753   \bitbox{1}{${\text{\tt A}}$}
754   \bitbox{1}{$\overline{\text{\tt A}}$}
755   \bitbox{1}{${\text{\tt B}}$}
756   \bitbox{1}{$\overline{\text{\tt B}}$}
757   \bitbox{1}{${\text{{\tt C}\ }}$}
758   \bitbox{1}{$\overline{\text{{\tt C}\ }}$}
759 \end{bytefield}}
760 \end{center}
761
762 Each bit corresponds to one possible input; all inputs whose bits are
763 set are {\tt OR}ed together, and the resulting value is assigned to
764 the flag.  Note that if none of the bits are set, the value assigned
765 is zero.  Note also that it is possible to produce a {\tt 1} by {\tt
766   OR}ing any flag with its complement, and that {\tt set Flags} can
767 be used to create a {\tt nop} (no-op) by setting each flag to itself.
768
769
770 \color{black}
771
772 \pagebreak
773 \subsection{{\tt shift}}
774
775 \newcommand{\shiftImmediateSize}{19}
776
777 Each {\tt shift} instruction carries an immediate of \shiftImmediateSize\ 
778 bits.  When a {\tt shift} instruction is executed, this immediate is copied
779 into the least significant \shiftImmediateSize\  bits of the data latch,
780 and the remaining most significant bits of the data latch are loaded
781 with the value formerly in the least significant bits of the data latch.
782 In this manner, large literals can be built up by ``shifting'' them
783 into the data latch \shiftImmediateSize\ bits at a time.
784
785 \newcommand{\bitsShift}{
786 \setlength{\bitwidth}{5mm}
787 {\tt
788 \begin{bytefield}{26}
789   \bitheader[b]{0,18-20}\\
790 \color{light}
791   \bitsHeaderNoI
792 \color{black}
793   \bitbox{1}{0} 
794   \bitbox{1}{0} 
795 \color{black}
796   \bitbox{\shiftImmediateSize}{Immediate} 
797 \end{bytefield}}
798 }
799 \bitsShift
800
801 The FleetTwo implementation is likely to have an unarchitected
802 ``literal latch'' at the on deck ({\tt OD}) stage, which is loaded
803 with the literal {\it at the time that the {\tt shift} instruction
804   comes on deck}.  This latch is then copied into the data latch when
805 the instruction executes.
806
807 \color{black}
808
809 \subsection{{\tt abort}}
810 \newcommand{\bitsAbort}{\setlength{\bitwidth}{5mm}
811 {\tt
812 \begin{bytefield}{26}
813   \bitheader[b]{17-20}\\
814 \color{light}
815   \bitsHeaderNoI
816 \color{black}
817   \bitbox{1}{1} 
818   \bitbox{1}{1} 
819   \bitbox{1}{0} 
820   \bitbox{1}{0} 
821 \color{light}
822   \bitbox[tbr]{17}{}
823 \end{bytefield}}}
824 \bitsAbort
825
826 An {\tt abort} instruction causes a loop to exit; see the section on
827 the Requeue Stage for further details.
828
829 \subsection{{\tt head}}
830 \newcommand{\bitsHead}{
831 \setlength{\bitwidth}{5mm}
832 {\tt
833 \begin{bytefield}{26}
834   \bitheader[b]{17-20}\\
835 \color{light}
836   \bitbox{5}{} 
837 \color{black}
838   \bitbox{1}{1}
839   \bitbox{1}{1}
840   \bitbox{1}{1}
841   \bitbox{1}{0}
842 \color{light}
843   \bitbox[tbr]{17}{} 
844 \end{bytefield}}}
845 \bitsHead
846
847 A {\tt head} instruction marks the start of a loop; see the section on
848 the Requeue Stage for further details.
849
850 \color{black}
851 \subsection{{\tt tail}}
852 \newcommand{\bitsTail}{
853 \setlength{\bitwidth}{5mm}
854 {\tt
855 \begin{bytefield}{26}
856   \bitheader[b]{17-20}\\
857 \color{light}
858   \bitbox{5}{} 
859 \color{black}
860   \bitbox{1}{1}
861   \bitbox{1}{1}
862   \bitbox{1}{1}
863   \bitbox{1}{1}
864 \color{light}
865   \bitbox[tbr]{17}{} 
866 \end{bytefield}}}
867 \bitsTail
868
869 A {\tt tail} instruction marks the end of a loop; see the section on
870 the Requeue Stage for further details.
871
872 \color{black}
873 %\pagebreak
874 %\subsection{{\tt takeOuterLoopCounter}}
875 %
876 %\setlength{\bitwidth}{5mm}
877 %{\tt
878 %\begin{bytefield}{26}
879 %  \bitheader[b]{16-19,21}\\
880 %\color{light}
881 %  \bitbox{1}{A}
882 %  \bitbox{1}{OS} 
883 %  \bitbox{2}{P}
884 %\color{black}
885 %  \bitbox{3}{000}
886 %  \bitbox{1}{0}
887 %  \bitbox{2}{11}
888 %\color{light}
889 %  \bitbox[tbr]{16}{} 
890 %\color{black}
891 %\end{bytefield}}
892 %
893 %This instruction copies the value in the outer loop counter {\tt OLC}
894 %into the least significant bits of the data latch and leaves all other
895 %bits of the data latch unchanged.
896 %
897 %\subsection{{\tt takeInnerLoopCounter}}
898 %
899 %\setlength{\bitwidth}{5mm}
900 %{\tt
901 %\begin{bytefield}{26}
902 %  \bitheader[b]{16-19,21}\\
903 %\color{light}
904 %  \bitbox{1}{A}
905 %  \bitbox{1}{OS} 
906 %  \bitbox{2}{P}
907 %\color{black}
908 %  \bitbox{3}{???}
909 %  \bitbox{1}{?}
910 %  \bitbox{2}{??}
911 %\color{light}
912 %  \bitbox[tbr]{16}{} 
913 %\color{black}
914 %\end{bytefield}}
915 %
916 %This instruction copies the value in the inner loop counter {\tt ILC}
917 %into the least significant bits of the data latch and leaves all other
918 %bits of the data latch unchanged.
919 %
920 %
921 %
922 %%\pagebreak
923 %%\subsection{{\tt interrupt}}
924 %%
925 %%\setlength{\bitwidth}{5mm}
926 %{\tt
927 %\begin{bytefield}{26}
928 %  \bitheader[b]{0,5,16-19,21}\\
929 %\color{light}
930 %  \bitbox{4}{} 
931 %\color{black}
932 %  \bitbox{3}{000} 
933 %  \bitbox{1}{1}
934 %  \bitbox{2}{00}
935 %\color{light}
936 %  \bitbox[tbr]{16}{} 
937 %\end{bytefield}}
938 %
939 %When an {\tt interrupt} instruction reaches {\tt IH}, it will wait
940 %there for the {\tt OD} stage to be full with an instruction that has
941 %the {\tt IM} bit set.  When this occurs, the instruction at {\tt OD}
942 %{\it will not execute}, but {\it may reloop} if the conditions for
943 %relooping are met.
944 %\footnote{The ability to interrupt an instruction yet have it reloop is very
945 %useful for processing chunks of data with a fixed size header and/or
946 %footer and a variable length body.}
947 %
948 %
949 %\subsection{{\tt massacre}}
950 %
951 %\setlength{\bitwidth}{5mm}
952 %{\tt
953 %\begin{bytefield}{26}
954 %  \bitheader[b]{16-19,21}\\
955 %\color{light}
956 %  \bitbox{4}{} 
957 %\color{black}
958 %  \bitbox{3}{000} 
959 %  \bitbox{1}{1}
960 %  \bitbox{2}{01}
961 %\color{light}
962 %  \bitbox[tbr]{16}{} 
963 %\color{black}
964 %\end{bytefield}}
965 %
966 %When a {\tt massacre} instruction reaches {\tt IH}, it will wait there
967 %for the {\tt OD} stage to be full with an instruction that has the
968 %{\tt IM} bit set.  When this occurs, all instructions in the
969 %instruction fifo (including {\tt OD}) are retired.
970 %
971 %\subsection{{\tt clog}}
972 %
973 %\setlength{\bitwidth}{5mm}
974 %{\tt
975 %\begin{bytefield}{26}
976 %  \bitheader[b]{16-19,21}\\
977 %\color{light}
978 %  \bitbox{4}{} 
979 %\color{black}
980 %  \bitbox{3}{000} 
981 %  \bitbox{1}{1}
982 %  \bitbox{2}{10}
983 %\color{light}
984 %  \bitbox[tbr]{16}{} 
985 %\color{black}
986 %\end{bytefield}}
987 %
988 %When a {\tt clog} instruction reaches {\tt OD}, it remains there and
989 %no more instructions will be executed until an {\tt unclog} is
990 %performed.
991 %
992 %\subsection{{\tt unclog}}
993 %
994 %\setlength{\bitwidth}{5mm}
995 %{\tt
996 %\begin{bytefield}{26}
997 %  \bitheader[b]{16-19,21}\\
998 %\color{light}
999 %  \bitbox{4}{} 
1000 %\color{black}
1001 %  \bitbox{3}{000} 
1002 %  \bitbox{1}{1}
1003 %  \bitbox[lrtb]{2}{11}
1004 %\color{light}
1005 %  \bitbox[tbr]{16}{} 
1006 %\color{black}
1007 %\end{bytefield}}
1008 %
1009 %When an {\tt unclog} instruction reaches {\tt IH}, it will wait there
1010 %until a {\tt clog} instruction is at {\tt OD}.  When this occurs, both
1011 %instructions retire.
1012 %
1013 %Note that issuing an {\tt unclog} instruction to a dock which is not
1014 %clogged and whose instruction fifo contains no {\tt clog} instructions
1015 %will cause the dock to deadlock.
1016
1017
1018
1019 \pagebreak
1020 \section*{Instruction Encoding Map\color{black}}
1021
1022
1023 \vspace{3mm}\hspace{-1cm}{\tt shift}\hspace{1cm}\vspace{-6mm}\\
1024 \bitsShift
1025
1026 \vspace{3mm}\hspace{-1cm}{\tt set}\hspace{1cm}\vspace{-6mm}\\
1027 \bitsSet
1028
1029 \vspace{3mm}\hspace{-1cm}{\tt move}\hspace{1cm}\vspace{-6mm}\\
1030 \bitsMove
1031 \bitsFlush
1032
1033 \vspace{3mm}\hspace{-1cm}{\tt abort}\hspace{1cm}\vspace{-6mm}\\
1034 \bitsAbort
1035
1036 \vspace{3mm}\hspace{-1cm}{\tt head}\hspace{1cm}\vspace{-6mm}\\
1037 \bitsHead
1038
1039 \vspace{3mm}\hspace{-1cm}{\tt tail}\hspace{1cm}\vspace{-6mm}\\
1040 \bitsTail
1041
1042
1043 %\pagebreak
1044 %\epsfig{file=all,height=5in,angle=90}
1045
1046 %\pagebreak
1047 %\subsection*{Input Dock}
1048 %\epsfig{file=in,width=8in,angle=90}
1049
1050 %\pagebreak
1051 %\subsection*{Output Dock}
1052 %\epsfig{file=out,width=8in,angle=90}
1053
1054
1055 %\pagebreak
1056 %\epsfig{file=ports,height=5in,angle=90}
1057
1058 %\pagebreak
1059 %\epsfig{file=best,height=5in,angle=90}
1060
1061
1062 \end{document}