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