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