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