c29ce941ddc1c5aa169ed020d83f678791beb2b4
[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 7.9in
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 16-Jun
70 & \color{red} When a torpedo strikes, {\tt ILC} is set to {\tt 1} \\
71 & \color{red} Only {\tt move} can be torpedoed (removed {\tt I}-bit from {\tt set}/{\tt shift}) \\
72 11-Jun
73 & Changed all uses of ``Payload'' to ``Immediate'' \color{black} (not in red) \\
74 & Reworked encoding of {\tt set} instruction \\
75 \color{black} 
76 06-Jun
77 & Factored in Russell Kao's comments (thanks!)\\
78 & Added mechanism for setting C-flag from fabric even on outboxes\\
79 05-Jun
80 & Made {\tt OLC} test a predicate-controlled condition\\
81 & Rewrote ``on deck'' section \\
82 & Added ``{\tt unset}'' value for {\tt ILC}\\
83 & Changed {\tt DP} to {\tt DataPredecessor} for clarity\\
84 \color{black}
85 30-Apr
86 & added comment about address-to-path ship \\
87 & changed {\tt DST} field of {\tt set} instruction from 2 bits to 3 \\
88 & changed the order of instructions in the encoding map \\
89 23-Apr
90 & added epilogue fifo to diagrams \\
91 & indicated that a token sent to the instruction port is treated as a torpedo \\
92 18-Apr
93 & replaced {\tt setInner}, {\tt setOuter}, {\tt setFlags} with unified {\tt set} instruction \\
94 & replaced {\tt literal} with {\tt shift} instruction \\
95 17-Apr
96 & Made all instructions except {\tt setOuter} depend on {\tt OLC>0}  \\
97 & Removed ability to manually set the {\tt C} flag  \\
98 & Expanded predicate field to three bits \\
99 & New literals scheme (via shifting) \\
100 & Instruction encoding changes made at Ivan's request (for layout purposes) \\
101 & Added summary of instruction encodings on last page \\
102 %07-Apr
103 %& removed ``+'' from ``potentially torpedoable'' row where it does not occur in Execute  \\
104 %06-Apr
105 %& extended {\tt LiteralPath} to 13 bits (impl need not use all of them)  \\
106 %& update table 3.1.2  \\
107 %& rename {\tt S} flag to {\tt C}  \\
108 %& noted that {\tt setFlags} can be used as {\tt nop} \\
109 %29-Mar
110 %& removed the {\tt L} flag (epilogues can now do this) \\
111 %& removed {\tt take\{Inner|Outer\}LoopCounter} instructions \\
112 %& renamed {\tt data} instruction to {\tt literal} \\
113 %& renamed {\tt send} instruction to {\tt move} \\
114 %23-Mar
115 %& added ``if its predicate is true'' to repeat count \\
116 %& added note that red wires do not contact ships \\
117 %& changed name of {\tt flags} instruction to {\tt setFlags} \\
118 %& removed black dot from diagrams \\
119 %& changed {\tt OL} (Outer Loop participant) to {\tt OS} (One Shot) and inverted polarity \\
120 %& indicated that the death of the {\tt tail} instruction is what causes the hatch to be unsealed \\
121 %& indicated that only {\tt send} instructions which wait for data are torpedoable \\
122 %& added section ``Torpedo Details'' \\
123 %& removed {\tt torpedo} instruction \\
124 %12-Mar
125 %\color{black}
126 %& renamed loop+repeat to outer+inner (not in red) \\
127 %& renamed {\tt Z} flag to {\tt L} flag (not in red) \\
128 %& rewrote ``inner and outer loops'' section \\
129 %& updated all diagrams \\
130 %\color{black}
131 %7-Mar
132 %& Moved address bits to the LSB-side of a 37-bit instruction \\
133 %& Added {\it micro-instruction} and {\it composite instruction} terms \\
134 %& Removed the {\tt DL} field, added {\tt decrement} mode to {\tt loop} \\
135 %& Created the {\tt Hold} field \\
136 %& Changed how ReLooping works \\
137 %& Removed {\tt clog}, {\tt unclog}, {\tt interrupt}, and {\tt massacre} \\
138 \end{tabular}
139 \end{abstract}
140
141 \vfill
142
143 \begin{center}
144 \epsfig{file=all,height=1.5in}
145 \epsfig{file=overview-new,height=1.5in}
146 \end{center}
147
148 \pagebreak
149
150 \section{Overview of Fleet}
151
152 A Fleet processor is organized around a {\it switch fabric}, which is
153 a packet-switched network with reliable in-order delivery.  The switch
154 fabric is used to carry data between different functional units,
155 called {\it ships}.  Each ship is connected to the switch fabric by
156 one or more programmable elements known as {\it docks}.
157
158 A {\it path} specifies a route through the switch fabric from a
159 particular {\it source} to a particular {\it destination}.  The
160 combination of a path and a single word to be delivered is called a
161 {\it packet}.  The switch fabric carries packets from their sources to
162 their destinations.  Each dock has two destinations: one for {\it
163   instructions} and one for {\it data}.  A Fleet is programmed by
164 depositing instruction packets into the switch fabric with paths that
165 will lead them to instruction destinations of the docks at which they
166 are to execute.
167
168 When a packet arrives at the instruction destination of a dock, it is
169 enqueued for execution.  Before the instruction executes, it may cause
170 the dock to wait for a packet to arrive at the dock's data destination
171 or for a value to be presented by the ship.  When an instruction
172 executes it may consume this data and may present a data value to the
173 ship or transmit a packet.
174
175 When an instruction sends a packet into the switch fabric, it may
176 specify that the payload of the packet is irrelevant.  Such packets
177 are known as {\it tokens}, and consume less energy than data packets.
178
179
180 \begin{center}
181 \epsfig{file=overview-new,width=2.5in}\\
182 {\it Overview of a Fleet processor; dark gray shading represents the
183   switch fabric, ships are shown in light gray, and docks are shown in blue.}
184 \end{center}
185 \color{black}
186
187 \pagebreak
188
189 \section{The FleetTwo Dock}
190
191 The diagram below represents a conceptual view of the interface
192 between ships and the switch fabric; actual implementation circuitry
193 may differ.
194
195 \begin{center}
196 \epsfig{file=all,width=3.5in}\\
197 {\it An ``input'' dock and ``output'' dock connected to a ship.  Solid
198   blue lines carry either tokens or data words, red lines carry either
199   instructions or torpedoes, and dashed lines carry only tokens.}
200 \end{center}
201
202 Each dock consists of a {\it data latch}, which is as wide as a single
203 machine word and a {\it pump}, which is a circular fifo of
204 instruction-width latches.  The values in the pump control the data
205 latch.  The dock also includes a {\it path latch}, which
206 stores the path along which outgoing packets will be sent.\color{black}
207
208 Note that the pump in each dock has a destination of its own; this is
209 the {\it instruction destination} mentioned in the previous section.
210
211 From any source to any dock's data destination there are
212 two distinct paths which differ by a single bit.  This bit is known as
213 the ``signal'' bit, and the routing of a packet is not affected by it;
214 the signal bit is used to pass control values between docks.  Note that paths
215 terminating at an {\it instruction} destination need not have a signal
216 bit.  \color{black}
217
218 \pagebreak
219 \section{Instructions}
220
221 In order to cause an instruction to execute, the programmer must first
222 arrange for that instruction word to arrive in the data latch of some
223 output dock.  For example, this might be the ``data read'' output dock
224 of the memory access ship or the output of a fifo ship.  Once an
225 instruction has arrived at this output dock, it is {\it dispatched} by
226 sending it to the {\it instruction port} of the dock at which it is to
227 execute.
228
229 Each instruction is 26 bits long, which makes it possible for an
230 instruction and an 11-bit path to fit in a single word of memory.
231 This path is the path from the {\it dispatching} dock to the {\it
232   executing} dock.
233
234 \setlength{\bitwidth}{3.5mm}
235 {\tt \footnotesize
236 \begin{bytefield}{37}
237   \bitheader[b]{0,10,11,36}\\
238   \bitbox{26}{instruction} 
239   \bitbox{11}{dispatch path} 
240 \end{bytefield}}
241
242
243
244
245 \subsection{Life Cycle of an Instruction}
246
247 The diagram below shows an input dock for purposes of illustration:
248
249 \begin{center}
250 \epsfig{file=in,width=4in}\\
251 {\it an input dock}
252 \end{center}
253
254 Note the mux on the path between {\tt EF} (epilogue fifo) and {\tt IF}
255 (instruction fifo); this is known as ``the hatch''.  The hatch has two
256 states: sealed and unsealed.  When the machine powers up, the hatch is
257 unsealed; it is sealed by the {\tt tail} instruction and unsealed
258 whenever the outer loop counter is set to zero (for any
259 reason\footnote{this includes {\tt OLC} being decremented to zero, a
260   {\tt set} instruction, or the occurrence
261   of a torpedo}).
262
263 When an instruction arrives at the epilogue fifo ({\tt EF}), it waits
264 there until the hatch is in the unsealed state; the instruction then
265 enters the instruction fifo.  When an instruction emerges from the
266 instruction fifo, it arrives at the ``on deck'' ({\tt OD}) stage,
267 where it may execute.
268
269 \begin{center}
270 \epsfig{file=out,width=4in}\\
271 {\it an output dock}
272 \end{center}
273
274 \subsubsection{Torpedoes}
275
276 A token sent to an instruction destination is called a {\it torpedo}.
277 When a torpedo arrives at the tail of {\tt EF}, it is deposited in a
278 waiting area (not shown) rather than being enqueued into {\tt EF}.
279
280 There is a latch (not shown) called the {\it torpedo acknowledgment path
281   latch} ({\tt TAPL}) which stores a path.  When a torpedo is consumed
282 (see section ``On Deck''), a token is sent along the path held in this
283 latch.
284
285 \subsection{Format of an Instruction}
286
287 All instruction words have the following format:
288
289 \newcommand{\bitsHeader}{
290   \bitbox{1}{I} 
291   \bitbox{1}{OS}
292   \bitbox{3}{P} 
293 }
294 \newcommand{\bitsHeaderNoI}{
295   \bitbox{1}{} 
296   \bitbox{1}{OS}
297   \bitbox{3}{P} 
298 }
299
300 \setlength{\bitwidth}{3.5mm}
301 {\tt \footnotesize
302 \begin{bytefield}{37}
303   \bitheader[b]{0,10,11,31,32,34-36}\\
304 \color{black}
305   \bitsHeader
306 \color{light}
307   \bitbox[tbr]{21}{} 
308   \bitbox{11}{dispatch path} 
309 \color{black}
310 \end{bytefield}}
311
312 \begin{itemize}
313 \item The {\tt I} bit stands for {\tt Interruptible}, and indicates if an
314 instruction is vulnerable to torpedoes.  This bit only appears in {\tt move} instructions.
315
316 \item The {\tt OS} (``One Shot'') bit indicates whether or not this
317   instruction can pass through the pump more than once.  If set to
318   {\tt 1}, then the instruction is a ``one-shot'' instruction, and
319   does not pass through the instruction fifo more than once.
320
321 \item  The {\tt P} bits are a {\it predicate}; this
322 holds a code which indicates if the instruction should be executed or
323 ignored depending on the state of flags in the dock.
324 \end{itemize}
325
326 \pagebreak
327 \subsection{Loop Counters}
328
329 A programmer can perform two types of loops: {\it inner} loops of only
330 one instruction and {\it outer} loops of multiple instructions.  Inner
331 loops may be nested within an outer loop, but no other nesting of
332 loops is allowed.
333
334 The dock has two loop counters, one for each kind of loop:
335
336 \begin{itemize}
337 \item {\tt OLC} is the Outer Loop Counter
338 \item {\tt ILC} is the Inner Loop Counter
339 \end{itemize}
340
341 The {\tt OLC} applies to all instructions and can hold integers {\tt
342   0..MAX_OLC}.
343
344 The {\tt ILC} applies only to {\tt move} instructions and can hold
345 integers {\tt 0..MAX_ILC} as well as a special value: $\infty$.  When
346 {\tt ILC=0} the next {\tt move} instruction executes zero times (ie is
347 ignored).  When {\tt ILC=$\infty$} the next {\tt move} instruction
348 executes until interrupted by a torpedo.  After every {\tt move}
349 instruction the {\tt ILC} is reset to {\tt 1} (note that it is reset
350 to {\tt 1}, {\it not to 0}).
351
352 \color{black}
353 \subsection{Flags and Predication}
354
355 The pump has three flags: {\tt A}, {\tt B}, and {\tt C}.
356
357 \begin{itemize}
358 \item The {\tt A} and {\tt B} flags are general-purpose flags which
359       may be set and cleared by the programmer.
360
361 %\item
362 %
363 % The {\tt L} flag, known as the {\it last} flag, is set whenever
364 %      the value in the outer counter ({\tt OLC}) is one,
365 \color{black}
366 % indicating
367 %      that the dock is in the midst of the last iteration of an
368 %      outer loop.  This flag can be used to perform certain
369 %      operations (such as sending a completion token) only on the last
370 %      iteration of an outer loop.
371
372 \item The {\tt C} flag is known as the {\it control} flag, and may be
373       set by the {\tt move} instruction based on information from the
374       ship or from an inbound packet.  See the {\tt move} instruction
375       for further details.
376 \color{black}
377
378 \end{itemize}
379
380 The {\tt P} field specifies a three-bit {\it predicate}.  The
381 predicate determines which conditions must be true in order for the
382 instruction to execute; if it is not executed, it is simply {\it
383   ignored}.  The table below shows what conditions must be true in
384 order for an instruction to execute:
385
386 \begin{center}
387 \begin{tabular}{|r|ll|}\hline
388 Code       & Execute & if \\\hline
389 {\tt 000:} & {\tt OLC$\neq$0} & and {\tt A=0} \\
390 {\tt 001:} & {\tt OLC$\neq$0} & and {\tt A=1} \\
391 {\tt 010:} & {\tt OLC$\neq$0} & and {\tt B=0} \\
392 {\tt 011:} & {\tt OLC$\neq$0} & and {\tt B=1} \\
393 {\tt 100:} & {\tt OLC$\neq$0} & and {\tt C=0} \\
394 {\tt 101:} & {\tt OLC$\neq$0} & and {\tt C=1} \\
395 {\tt 110:} & {\tt OLC$\neq$0} & \\
396 {\tt 111:} & always & \\
397 \hline\end{tabular}
398 \end{center}
399
400 \pagebreak
401 \subsection{On Deck}
402
403 When an instruction arrives on deck, two concurrent processes are
404 started.  No subsequent instruction may come on deck until both
405 processes have completed:
406
407 \begin{enumerate}
408
409 \item Requeueing:
410       \begin{itemize}
411       \item If the outer loop counter is zero ({\tt OLC=0}) or the
412             instruction on deck is a one-shot instruction ({\tt
413             OS=1}), do nothing.
414       \item {\it Otherwise} wait for the hatch to be sealed and
415             enqueue a copy of the instruction currently on deck.
416       \end{itemize}
417
418 \item Execution:
419
420       \begin{itemize}
421       \item
422       If the instruction's predicate condition is not met (see
423       section on predicates), do nothing.
424
425       \item
426       {\it Otherwise} if the instruction is interruptible ({\tt I=0})
427       and a torpedo is present in the waiting area: consume the
428       torpedo, set the outer loop counter to zero ({\tt OLC=0}),
429       \color{red}set the inner loop counter to one ({\tt ILC=1}),\color{black}\ 
430       unseal the hatch, and transmit a token along in the
431       {\it torpedo acknowledgment path latch} ({\tt TAPL}).
432
433       \item
434       {\it Otherwise} if {\tt ILC$\neq$0} or the instruction is {\it
435       not} a {\tt move}: execute the instruction.
436       \end{itemize}
437 \end{enumerate}
438
439
440 \color{black}
441
442
443 \pagebreak
444 \section{Instructions}
445
446 The dock supports for instructions:
447 {\tt move} (variants: {\tt moveto}, {\tt dispatch}),
448 {\tt shift},
449 {\tt set}, and
450 {\tt tail}.
451 \color{black}
452
453
454 \subsection{{\tt move} (variants: {\tt moveto}, {\tt dispatch})}
455
456 \newcommand{\bitsMove}{\setlength{\bitwidth}{5mm}
457 {\tt
458 \begin{bytefield}{26}
459   \bitheader[b]{14-20}\\
460 \color{light}
461   \bitsHeader
462 \color{black}
463   \bitbox{1}{0} 
464   \bitbox{1}{1} 
465   \bitbox{1}{\tt Ti}
466   \bitbox{1}{\tt Di}
467   \bitbox{1}{\tt Dc}
468   \bitbox{1}{\tt Do}
469   \bitbox{1}{\tt To}
470   \bitbox[l]{19}{}
471 \end{bytefield}}
472
473 \begin{bytefield}{26}
474   \bitheader[b]{0,12,13}\\
475   \bitbox[1]{11}{\raggedleft {\tt moveto} ({\tt Immediate\to Path})}
476   \bitbox[r]{1}{}
477   \bitbox{1}{\tt 1}
478   \bitbox{13}{\tt Immediate}
479 \end{bytefield}
480
481 \begin{bytefield}{26}
482   \bitheader[b]{11,12,13}\\
483   \bitbox[1]{11}{\raggedleft {\tt dispatch} ({\footnotesize {\tt DataPredecessor[37:25]\to Path}})\ \ }
484   \bitbox[r]{1}{}
485   \bitbox{1}{\tt 0}
486   \bitbox{1}{\tt 1}
487 \color{light}
488   \bitbox[trb]{12}{}
489 \color{black}
490 \end{bytefield}
491
492 \begin{bytefield}{26}
493   \bitheader[b]{11,12,13}\\
494   \bitbox[1]{11}{\raggedleft {\tt move} ({\tt Path} unchanged):}
495   \bitbox[r]{1}{}
496   \bitbox{1}{\tt 0}
497   \bitbox{1}{\tt 0}
498 \color{light}
499   \bitbox[trb]{12}{}
500 \color{black}
501 \end{bytefield}}
502 \bitsMove
503
504 \begin{itemize}
505 \item {\tt Ti} - Token Input: wait for the token predecessor to be full and drain it.
506 \item {\tt Di} - Data Input: wait for the data predecessor to be full and drain it.
507 \item {\tt Dc} - Data Capture: pulse the data latch.
508 \item {\tt Do} - Data Output: fill the data successor.
509 \item {\tt To} - Token Output: fill the token successor.
510 \end{itemize}
511
512 The data successor and token successor must both be empty in order for
513 a {\tt move} instruction to attempt execution.
514
515 Every time the {\tt move} instruction executes, the {\tt C} flag may
516 be set:
517
518 \begin{itemize}
519 \item At an {\it input} dock the {\tt C} flag is set to the signal bit
520       of the incoming packet if {\tt Di} or {\tt Ti} is set.
521
522 \item At an {\it output} dock the {\tt C} flag is set to a value
523       provided by the ship if the {\tt Di} bit is set, and to the
524       signal bit of the incoming packet if {\tt Di} is clear and {\tt
525       Ti} is set.
526 \end{itemize}
527
528 \color{black}
529
530 \pagebreak
531
532 \subsection{{\tt set}}
533
534 The {\tt set} command is used to set or decrement the inner loop
535 counter, outer loop counter, and data latch.
536
537 \newcommand{\bitsSet}{
538 \setlength{\bitwidth}{5mm}
539 {\tt
540 \begin{bytefield}{26}
541   \bitheader[b]{19-25}\\
542   \bitsHeaderNoI
543   \bitbox{1}{1}
544   \bitbox{1}{0} 
545 \color{light}
546   \bitbox{5}{Dest} 
547   \bitbox{14}{} 
548 \color{black}
549 \end{bytefield}}
550
551 \begin{bytefield}{26}
552   \bitheader[b]{0,5,11-18}\\
553   \bitbox[1]{6}{\raggedleft {\tt Immediate}\to{\tt OLC}}
554   \bitbox[r]{1}{}
555   \bitbox{5}{\tt 10000}
556   \bitbox{3}{\tt 100}
557   \bitbox{5}{}
558   \bitbox{6}{\tt Immediate}
559 \end{bytefield}
560
561 \begin{bytefield}{26}
562   \bitheader[b]{11-18}\\
563   \bitbox[1]{6}{\raggedleft {\tt Data Latch}\to{\tt OLC}}
564   \bitbox[r]{1}{}
565   \bitbox{5}{\tt 10000}
566   \bitbox{3}{\tt 010}
567   \bitbox{11}{}
568 \end{bytefield}
569
570 \begin{bytefield}{26}
571   \bitheader[b]{11-18}\\
572   \bitbox[1]{6}{\raggedleft {\tt OLC-1}\to{\tt OLC}}
573   \bitbox[r]{1}{}
574   \bitbox{5}{\tt 10000}
575   \bitbox{3}{\tt 001}
576   \bitbox{11}{}
577 \end{bytefield}
578
579 \begin{bytefield}{26}
580   \bitheader[b]{0,5,6,11-18}\\
581   \bitbox[1]{6}{\raggedleft {\tt Immediate}\to{\tt ILC}}
582   \bitbox[r]{1}{}
583   \bitbox{5}{\tt 01000}
584   \bitbox{3}{\tt 100}
585   \bitbox{4}{}
586   \bitbox{1}{\tt 0}
587   \bitbox{6}{\tt Immediate}
588 \end{bytefield}
589
590 \begin{bytefield}{26}
591   \bitheader[b]{6,11-18}\\
592   \bitbox[1]{6}{\raggedleft $\infty$\to{\tt ILC}}
593   \bitbox[r]{1}{}
594   \bitbox{5}{\tt 01000}
595   \bitbox{3}{\tt 100}
596   \bitbox{4}{}
597   \bitbox{1}{\tt 1}
598   \bitbox{6}{}
599 \end{bytefield}
600
601 \begin{bytefield}{26}
602   \bitheader[b]{11-18}\\
603   \bitbox[1]{6}{\raggedleft {\tt Data Latch}\to{\tt ILC}}
604   \bitbox[r]{1}{}
605   \bitbox{5}{\tt 01000}
606   \bitbox{3}{\tt 010}
607   \bitbox{11}{}
608 \end{bytefield}
609
610 \begin{bytefield}{26}
611   \bitheader[b]{0,12,13-18}\\
612   \bitbox[1]{6}{\raggedleft \footnotesize {\tt 0-Extended Immediate}\to{\tt Data Latch}}
613   \bitbox[r]{1}{}
614   \bitbox{5}{\tt 00100}
615   \bitbox{1}{\tt 0}
616   \bitbox{13}{\tt Immediate}
617 \end{bytefield}
618
619 \begin{bytefield}{26}
620   \bitheader[b]{0,12,13-18}\\
621   \bitbox[1]{6}{\raggedleft \footnotesize {\tt 1-Extended Immediate}\to{\tt Data Latch}}
622   \bitbox[r]{1}{}
623   \bitbox{5}{\tt 00100}
624   \bitbox{1}{\tt 1}
625   \bitbox{13}{\tt Immediate}
626 \end{bytefield}
627
628 \begin{bytefield}{26}
629   \bitheader[b]{0,5,6,11,14-18}\\
630   \bitbox[1]{6}{\raggedleft {\tt Update Flags}}
631   \bitbox[r]{1}{}
632   \bitbox{5}{\tt 00010}
633   \bitbox{2}{}
634   \bitbox{6}{\tt nextA}
635   \bitbox{6}{\tt nextB}
636 \end{bytefield}
637
638 \begin{bytefield}{26}
639   \bitheader[b]{0,12,14-18}\\
640   \bitbox[1]{6}{\raggedleft {\tt Immediate}\to{\tt TAPL}}
641   \bitbox[r]{1}{}
642   \bitbox{5}{\tt 00001}
643   \bitbox{1}{}
644   \bitbox{13}{\tt Immediate}
645 \end{bytefield}
646
647 \color{black}
648
649 }
650 \bitsSet
651
652 The FleetTwo implementation is likely to have an unarchitected
653 ``literal latch'' at the on deck ({\tt OD}) stage, which is loaded
654 with the possibly-extended literal {\it at the time that the {\tt set}
655   instruction comes on deck}.  This latch is then copied into the data
656 latch when a {\tt set Data Latch} instruction
657 executes\color{black}.
658
659 Each of the {\tt nextA} and {\tt nextB} fields has the following
660 structure, and indicates which old flag values should be logically
661 {\tt OR}ed together to produce the new flag value:
662
663 \begin{center}
664 {\tt
665 \begin{bytefield}{6}
666   \bitheader[b]{0-5}\\
667   \bitbox{1}{${\text{\tt A}}$}
668   \bitbox{1}{$\overline{\text{\tt A}}$}
669   \bitbox{1}{${\text{\tt B}}$}
670   \bitbox{1}{$\overline{\text{\tt B}}$}
671   \bitbox{1}{${\text{{\tt C}\ }}$}
672   \bitbox{1}{$\overline{\text{{\tt C}\ }}$}
673 \end{bytefield}}
674 \end{center}
675
676 Each bit corresponds to one possible input; all inputs whose bits are
677 set are {\tt OR}ed together, and the resulting value is assigned to
678 the flag.  Note that if none of the bits are set, the value assigned
679 is zero.  Note also that it is possible to produce a {\tt 1} by {\tt
680   OR}ing any flag with its complement, and that {\tt set Flags} can
681 be used to create a {\tt nop} (no-op) by setting each flag to itself.
682
683
684 \color{black}
685
686 \pagebreak
687 \subsection{{\tt shift}}
688
689 \newcommand{\shiftImmediateSize}{19}
690
691 Each {\tt shift} instruction carries an immediate of \shiftImmediateSize\ 
692 bits.  When a {\tt shift} instruction is executed, this immediate is copied
693 into the least significant \shiftImmediateSize\  bits of the data latch,
694 and the remaining most significant bits of the data latch are loaded
695 with the value formerly in the least significant bits of the data latch.
696 In this manner, large literals can be built up by ``shifting'' them
697 into the data latch \shiftImmediateSize\ bits at a time.
698
699 \newcommand{\bitsShift}{
700 \setlength{\bitwidth}{5mm}
701 {\tt
702 \begin{bytefield}{26}
703   \bitheader[b]{0,18-20}\\
704 \color{light}
705   \bitsHeaderNoI
706 \color{black}
707   \bitbox{1}{0} 
708   \bitbox{1}{0} 
709 \color{black}
710   \bitbox{\shiftImmediateSize}{Immediate} 
711 \end{bytefield}}
712 }
713 \bitsShift
714
715 The FleetTwo implementation is likely to have an unarchitected
716 ``literal latch'' at the on deck ({\tt OD}) stage, which is loaded
717 with the literal {\it at the time that the {\tt shift} instruction
718   comes on deck}.  This latch is then copied into the data latch when
719 the instruction executes.
720
721 \color{black}
722
723 \subsection{{\tt tail}}
724
725 \newcommand{\bitsTail}{
726 \setlength{\bitwidth}{5mm}
727 {\tt
728 \begin{bytefield}{26}
729   \bitheader[b]{19-20}\\
730 \color{light}
731   \bitbox{5}{} 
732 \color{black}
733   \bitbox{1}{1}
734   \bitbox{1}{1}
735 \color{light}
736   \bitbox[tbr]{19}{} 
737 \end{bytefield}}}
738 \bitsTail
739
740 When a {\tt tail} instruction reaches the hatch, it seals the hatch.
741 The {\tt tail} instruction does not enter the instruction fifo.
742
743 \color{black}
744 %\pagebreak
745 %\subsection{{\tt takeOuterLoopCounter}}
746 %
747 %\setlength{\bitwidth}{5mm}
748 %{\tt
749 %\begin{bytefield}{26}
750 %  \bitheader[b]{16-19,21}\\
751 %\color{light}
752 %  \bitbox{1}{A}
753 %  \bitbox{1}{OS} 
754 %  \bitbox{2}{P}
755 %\color{black}
756 %  \bitbox{3}{000}
757 %  \bitbox{1}{0}
758 %  \bitbox{2}{11}
759 %\color{light}
760 %  \bitbox[tbr]{16}{} 
761 %\color{black}
762 %\end{bytefield}}
763 %
764 %This instruction copies the value in the outer loop counter {\tt OLC}
765 %into the least significant bits of the data latch and leaves all other
766 %bits of the data latch unchanged.
767 %
768 %\subsection{{\tt takeInnerLoopCounter}}
769 %
770 %\setlength{\bitwidth}{5mm}
771 %{\tt
772 %\begin{bytefield}{26}
773 %  \bitheader[b]{16-19,21}\\
774 %\color{light}
775 %  \bitbox{1}{A}
776 %  \bitbox{1}{OS} 
777 %  \bitbox{2}{P}
778 %\color{black}
779 %  \bitbox{3}{???}
780 %  \bitbox{1}{?}
781 %  \bitbox{2}{??}
782 %\color{light}
783 %  \bitbox[tbr]{16}{} 
784 %\color{black}
785 %\end{bytefield}}
786 %
787 %This instruction copies the value in the inner loop counter {\tt ILC}
788 %into the least significant bits of the data latch and leaves all other
789 %bits of the data latch unchanged.
790 %
791 %
792 %
793 %%\pagebreak
794 %%\subsection{{\tt interrupt}}
795 %%
796 %%\setlength{\bitwidth}{5mm}
797 %{\tt
798 %\begin{bytefield}{26}
799 %  \bitheader[b]{0,5,16-19,21}\\
800 %\color{light}
801 %  \bitbox{4}{} 
802 %\color{black}
803 %  \bitbox{3}{000} 
804 %  \bitbox{1}{1}
805 %  \bitbox{2}{00}
806 %\color{light}
807 %  \bitbox[tbr]{16}{} 
808 %\end{bytefield}}
809 %
810 %When an {\tt interrupt} instruction reaches {\tt IH}, it will wait
811 %there for the {\tt OD} stage to be full with an instruction that has
812 %the {\tt IM} bit set.  When this occurs, the instruction at {\tt OD}
813 %{\it will not execute}, but {\it may reloop} if the conditions for
814 %relooping are met.
815 %\footnote{The ability to interrupt an instruction yet have it reloop is very
816 %useful for processing chunks of data with a fixed size header and/or
817 %footer and a variable length body.}
818 %
819 %
820 %\subsection{{\tt massacre}}
821 %
822 %\setlength{\bitwidth}{5mm}
823 %{\tt
824 %\begin{bytefield}{26}
825 %  \bitheader[b]{16-19,21}\\
826 %\color{light}
827 %  \bitbox{4}{} 
828 %\color{black}
829 %  \bitbox{3}{000} 
830 %  \bitbox{1}{1}
831 %  \bitbox{2}{01}
832 %\color{light}
833 %  \bitbox[tbr]{16}{} 
834 %\color{black}
835 %\end{bytefield}}
836 %
837 %When a {\tt massacre} instruction reaches {\tt IH}, it will wait there
838 %for the {\tt OD} stage to be full with an instruction that has the
839 %{\tt IM} bit set.  When this occurs, all instructions in the
840 %instruction fifo (including {\tt OD}) are retired.
841 %
842 %\subsection{{\tt clog}}
843 %
844 %\setlength{\bitwidth}{5mm}
845 %{\tt
846 %\begin{bytefield}{26}
847 %  \bitheader[b]{16-19,21}\\
848 %\color{light}
849 %  \bitbox{4}{} 
850 %\color{black}
851 %  \bitbox{3}{000} 
852 %  \bitbox{1}{1}
853 %  \bitbox{2}{10}
854 %\color{light}
855 %  \bitbox[tbr]{16}{} 
856 %\color{black}
857 %\end{bytefield}}
858 %
859 %When a {\tt clog} instruction reaches {\tt OD}, it remains there and
860 %no more instructions will be executed until an {\tt unclog} is
861 %performed.
862 %
863 %\subsection{{\tt unclog}}
864 %
865 %\setlength{\bitwidth}{5mm}
866 %{\tt
867 %\begin{bytefield}{26}
868 %  \bitheader[b]{16-19,21}\\
869 %\color{light}
870 %  \bitbox{4}{} 
871 %\color{black}
872 %  \bitbox{3}{000} 
873 %  \bitbox{1}{1}
874 %  \bitbox[lrtb]{2}{11}
875 %\color{light}
876 %  \bitbox[tbr]{16}{} 
877 %\color{black}
878 %\end{bytefield}}
879 %
880 %When an {\tt unclog} instruction reaches {\tt IH}, it will wait there
881 %until a {\tt clog} instruction is at {\tt OD}.  When this occurs, both
882 %instructions retire.
883 %
884 %Note that issuing an {\tt unclog} instruction to a dock which is not
885 %clogged and whose instruction fifo contains no {\tt clog} instructions
886 %will cause the dock to deadlock.
887
888
889
890 \pagebreak
891 \section*{Instruction Encoding Map\color{black}}
892
893 \hspace{-1cm}{\tt shift}\\
894 \bitsShift
895
896 \hspace{-1cm}{\tt set}\\
897 \bitsSet
898
899 \hspace{-1cm}{\tt move}\\
900 \bitsMove
901
902 \hspace{-1cm}{\tt tail}\\
903 \bitsTail
904
905
906 \color{black}
907
908 \pagebreak
909 \epsfig{file=all,height=5in,angle=90}
910
911 \pagebreak
912 \subsection*{Input Dock}
913 \epsfig{file=in,width=8in,angle=90}
914
915 \pagebreak
916 \subsection*{Output Dock}
917 \epsfig{file=out,width=8in,angle=90}
918
919
920 %\pagebreak
921 %\epsfig{file=ports,height=5in,angle=90}
922
923 %\pagebreak
924 %\epsfig{file=best,height=5in,angle=90}
925
926
927 \end{document}