updates to am33
[fleet.git] / chips / marina / doc / am33 / am33.tex
1 \documentclass[10pt]{article}
2 \usepackage{palatino}
3 \usepackage{amsmath}
4 \usepackage{pdflscape}
5 \usepackage[figureright]{rotating}
6 \usepackage{epsfig}
7 \usepackage{color}
8 \usepackage{bytefield1}
9 \usepackage{wrapfig}
10 \usepackage{stmaryrd}
11 \usepackage{subfigure}
12 \usepackage{syntax}
13 \usepackage{comment}
14 \usepackage{fancyhdr}
15 \usepackage{lastpage}
16 \usepackage{multirow}
17 \usepackage{multicol}
18 \usepackage{rotating}
19 \include{megacz}
20 \bibliographystyle{alpha}
21 \pagestyle{fancyplain}
22
23 \definecolor{light}{gray}{0.7}
24
25 \setlength{\marginparwidth}{1.2in}
26 \let\oldmarginpar\marginpar
27 \renewcommand\marginpar[1]{\-\oldmarginpar[\raggedleft\footnotesize #1]%
28 {\raggedright\footnotesize #1}}
29
30
31 \newcommand{\footnoteremember}[2]{
32   \footnote{#2}
33   \newcounter{#1}
34   \setcounter{#1}{\value{footnote}}
35 } \newcommand{\footnoterecall}[1]{
36   \footnotemark[\value{#1}]
37 }
38
39 %\pdfpagewidth 8.5in
40 %\pdfpageheight 11in 
41 %\topmargin 0in
42 \textheight 8.2in
43 %\textwidth 6.0in
44 %\oddsidemargin 0.25in
45 %\evensidemargin 0.25in
46 %\headwidth 6.0in
47 \def\to{\ $\rightarrow$\ }
48
49 \def\docnum{AM33}
50
51 \author{
52 \normalsize{
53 \begin{tabular}{c}
54 \end{tabular}}
55 }
56
57 \title{\vspace{-1cm}AM33: The Marina Docks
58 \\
59 {\normalsize
60 Adam Megacz
61 }}
62
63 \begin{document}
64
65 \maketitle
66
67 \begin{abstract}
68
69 This document describes the instruction format for the docks on the
70 Marina test chip, as well as their software-visible behavior.  Two
71 subsequent memos will describe the chip's circuit design and
72 experimental results.
73
74 %Changes:
75 %
76 %\begin{tabular}{rl}
77 %29-Aug
78 %& Final version \\
79 %25-May
80 %& Added errata for Kessels counter on Marina test chip \\
81 %18-May
82 %& Added errata for Marina test chip \\
83 %17-Feb
84 %& Clarified setting of the {\tt C}-flag\color{black}\\
85 %& Removed {\tt OS} bit\color{black}\\
86 %& Changed instruction length from 26 bits to 25\color{black}\\
87 %& Updated which bits are used when the {\tt Path} latch captures from the data predecessor\color{black}\\
88 %05-Jan
89 %& Fixed a one-word typo \\
90 %02-Jan
91 %& Added {\tt head} instruction \\
92 %& Lengthened external encoding of {\tt tail} instruction by one bit \\
93 %& Added {\tt abort} instruction \\
94 %& Removed {\tt OS} field from instructions \\
95 %& Renamed the {\tt Z}-flag (olc {\bf Z}ero) to the {\tt D}-flag (loop {\bf D}one)\\
96 %19-Dec
97 %& Updated diagram in section 3 to put dispatch path near MSB\\
98 %& Changed DP[37:25] to DP[37:27]\\
99 %& Added note on page 4 regarding previous\\
100 %14-Nov
101 %& Roll back ``Distinguish {\tt Z}-flag from OLC=0'' \\
102 %& Clarify what ``{\tt X-Extended}'' means \\
103 %& Change C-bit source selector from {\tt Di} to {\tt Dc} \\
104 %07-Nov
105 %& Distinguish {\tt Z}-flag from OLC=0\\
106 %& Add {\tt flush} instruction\\
107 %& Change {\t I} bit from ``Interruptable'' to ``Immune''\\
108 %20-Sep
109 %& Update hatch description to match \href{http://fleet.cs.berkeley.edu/docs/people/ivan.e.sutherland/ies50-Requeue.State.Diagram.pdf}{IES50} \\
110 %28-Aug
111 %& Note that decision to requeue is based on  value of OLC {\it before} execution\\
112 %& Note that decision to open the hatch is based on value of {\tt OS} bit\\
113 %10-Jul
114 %& Added {\tt OLC=0} predicate \\
115 %& Eliminated {\tt TAPL} (made possible by previous change) \\
116 %& Expanded {\tt set} {\tt Immediate} field from 13 bits to 14 bits (made possible by previous change)\\
117 %09-Jul
118 %& Fixed a few typos \\
119 %& Added {\tt DataLatch}\to{\tt TAPL} (Amir's request) \\
120 %& Eliminate ability to predicate directly on {\tt C}-flag (Ivan's request) \\
121 %16-Jun
122 %& When a torpedo strikes, {\tt ILC} is set to {\tt 1} \\
123 %& Only {\tt move} can be torpedoed (removed {\tt I}-bit from {\tt set}/{\tt shift}) \\
124 %11-Jun
125 %& Changed all uses of ``Payload'' to ``Immediate'' \color{black} (not in red) \\
126 %& Reworked encoding of {\tt set} instruction \\
127 %\color{black} 
128 %06-Jun
129 %& Factored in Russell Kao's comments (thanks!)\\
130 %& Added mechanism for setting C-flag from fabric even on outboxes\\
131 %05-Jun
132 %& Made {\tt OLC} test a predicate-controlled condition\\
133 %& Rewrote ``on deck'' section \\
134 %& Added ``{\tt unset}'' value for {\tt ILC}\\
135 %& Changed {\tt DP} to {\tt DataPredecessor} for clarity\\
136 %\color{black}
137 %30-Apr
138 %& added comment about address-to-path ship \\
139 %& changed {\tt DST} field of {\tt set} instruction from 2 bits to 3 \\
140 %& changed the order of instructions in the encoding map \\
141 %23-Apr
142 %& added epilogue fifo to diagrams \\
143 %& indicated that a token sent to the instruction port is treated as a torpedo \\
144 %18-Apr
145 %& replaced {\tt setInner}, {\tt setOuter}, {\tt setFlags} with unified {\tt set} instruction \\
146 %& replaced {\tt literal} with {\tt shift} instruction \\
147 %17-Apr
148 %& Made all instructions except {\tt setOuter} depend on {\tt OLC>0}  \\
149 %& Removed ability to manually set the {\tt C} flag  \\
150 %& Expanded predicate field to three bits \\
151 %& New literals scheme (via shifting) \\
152 %& Instruction encoding changes made at Ivan's request (for layout purposes) \\
153 %& Added summary of instruction encodings on last page \\
154 %07-Apr
155 %& removed ``+'' from ``potentially torpedoable'' row where it does not occur in Execute  \\
156 %06-Apr
157 %& extended {\tt LiteralPath} to 13 bits (impl need not use all of them)  \\
158 %& update table 3.1.2  \\
159 %& rename {\tt S} flag to {\tt C}  \\
160 %& noted that {\tt setFlags} can be used as {\tt nop} \\
161 %29-Mar
162 %& removed the {\tt L} flag (epilogues can now do this) \\
163 %& removed {\tt take\{Inner|Outer\}LoopCounter} instructions \\
164 %& renamed {\tt data} instruction to {\tt literal} \\
165 %& renamed {\tt send} instruction to {\tt move} \\
166 %23-Mar
167 %& added ``if its predicate is true'' to repeat count \\
168 %& added note that red wires do not contact ships \\
169 %& changed name of {\tt flags} instruction to {\tt setFlags} \\
170 %& removed black dot from diagrams \\
171 %& changed {\tt OL} (Outer Loop participant) to {\tt OS} (One Shot) and inverted polarity \\
172 %& indicated that the death of the {\tt tail} instruction is what causes the hatch to be unsealed \\
173 %& indicated that only {\tt send} instructions which wait for data are torpedoable \\
174 %& added section ``Torpedo Details'' \\
175 %& removed {\tt torpedo} instruction \\
176 %12-Mar
177 %\color{black}
178 %& renamed loop+repeat to outer+inner (not in red) \\
179 %& renamed {\tt Z} flag to {\tt L} flag (not in red) \\
180 %& rewrote ``inner and outer loops'' section \\
181 %& updated all diagrams \\
182 %\color{black}
183 %7-Mar
184 %& Moved address bits to the LSB-side of a 37-bit instruction \\
185 %& Added {\it micro-instruction} and {\it composite instruction} terms \\
186 %& Removed the {\tt DL} field, added {\tt decrement} mode to {\tt loop} \\
187 %& Created the {\tt Hold} field \\
188 %& Changed how ReLooping works \\
189 %& Removed {\tt clog}, {\tt unclog}, {\tt interrupt}, and {\tt massacre} \\
190 %\end{tabular}
191 \end{abstract}
192
193 \vfill
194
195 \begin{center}
196 \epsfig{file=all,height=1.5in}
197 \epsfig{file=overview-new,height=1.5in}
198 \end{center}
199
200 \pagebreak
201
202 \section{Overview of Fleet}
203
204 A Fleet processor is organized around a {\it switch fabric}, which is
205 a packet-switched network with reliable in-order delivery.  The switch
206 fabric is used to carry data between different functional units,
207 called {\it ships}.  Each ship is connected to the switch fabric by
208 one or more programmable elements known as {\it docks}.
209
210 A {\it path} specifies a route through the switch fabric from a
211 particular {\it source} to a particular {\it destination}.  The
212 combination of a path and a single word to be delivered is called a
213 {\it packet}.  The switch fabric carries packets from their sources to
214 their destinations.  Each dock has two destinations: one for {\it
215   instructions} and one for {\it data}.  A Fleet is programmed by
216 depositing instruction packets into the switch fabric with paths that
217 will lead them to the instruction destinations of the docks at which they
218 are to execute.
219
220 When a packet arrives at the instruction destination of a dock, it is
221 enqueued for execution.  Before the instruction executes, it may cause
222 the dock to wait for a packet to arrive at the dock's data destination
223 or for a value to be presented by the ship.  When an instruction
224 executes it may consume this data and may present a data value to the
225 ship or transmit a packet.
226
227 When an instruction sends a packet into the switch fabric, it may
228 specify that the payload of the packet is irrelevant.  Such packets
229 are known as {\it tokens}, and consume less energy than data packets.
230
231
232 \begin{center}
233 \epsfig{file=overview-new,width=2.5in}\\
234 {\it Overview of a Fleet processor; dark gray shading represents the
235   switch fabric, ships are shown in light gray, and docks are shown in blue.}
236 \end{center}
237 \color{black}
238
239 \pagebreak
240
241 \section{The Marina Dock}
242
243 The diagram below represents a conceptual view of the interface
244 between ships and the switch fabric; actual implementation circuitry
245 may differ.
246
247 \begin{center}
248 \epsfig{file=all,width=3.5in}\\
249 {\it An ``input'' dock and ``output'' dock connected to a ship.  Solid
250   blue lines carry either tokens or data words, red lines carry either
251   instructions or torpedoes, and dashed lines carry only tokens.}
252 \end{center}
253
254 Each dock consists of a {\it data latch}, which is as wide as a single
255 machine word and a circular {\it instruction fifo} of
256 instruction-width latches.  The values in the instruction fifo control
257 the data latch.  The dock also includes a {\it path latch}, which
258 stores the path along which outgoing packets will be
259 sent.
260
261 Note that the instruction fifo in each dock has a destination of its
262 own; this is the {\it instruction destination} mentioned in the
263 previous section.  A token sent to an instruction destination is
264 called a {\it torpedo}; it does not enter the instruction fifo, but
265 rather is held in a waiting area where it may interrupt certain
266 instructions (see the section on the {\tt move} instruction for further
267 details).
268
269 From any source to any dock's data destination there are
270 two distinct paths which differ by a single bit.  This bit is known as
271 the ``signal'' bit, and the routing of a packet is not affected by it;
272 the signal bit is used to pass control values between docks.  Note that paths
273 terminating at an {\it instruction} destination need not have a signal
274 bit.
275
276 \pagebreak
277 \section{Instructions}
278
279 In order to cause an instruction to execute, the programmer must first
280 arrange for that instruction word to arrive in the data latch of some
281 output dock.  For example, this might be the ``data read'' output dock
282 of the memory access ship or the output of a fifo ship.  Once an
283 instruction has arrived at this output dock, it is {\it dispatched} by
284 sending it to the {\it instruction destination} of the dock at which
285 it is to execute.
286
287 There are two instruction formats, an {\it external format} described
288 in this section and an {\it internal format} described in the last
289 section of this memo.
290
291 Each instruction is 25\color{black}\ bits long, which makes it
292 possible for an instruction and an 12\color{black}-bit path to fit in
293 a single word of memory.  This path is the path from the {\it
294   dispatching} dock to the {\it executing} dock.
295
296 \vspace{0.5cm}
297
298 \setlength{\bitwidth}{3.5mm}
299 {\tt \footnotesize
300 \begin{bytefield}{37}
301   \bitheader[b]{0,24,25,36}\\
302   \bitbox{12}{dispatch path} 
303   \bitbox{25}{instruction (external format)} 
304 \end{bytefield}}
305 \color{black}
306
307 Note that the 12\color{black}\ bit {\tt dispatch path} field is not
308 the same width as the 13 bit {\tt Immediate} path field in the {\tt
309   move} instruction, which in turn may not be the same width as the
310 actual path latches in the switch fabric.  The algorithm for expanding
311 a path to a wider width is specific to the switch fabric
312 implementation, and may vary from Fleet to Fleet.  For the Marina
313 experiment, the correct algorithm is to sign-extend the path; the most
314 significant bit of the given path is used to fill the vacant bit of
315 the latch.  Because the {\tt dispatch path} field is always used to
316 specify a path which terminates at an instruction destination (never a
317 data destination), and because instruction destinations ignore the
318 signal bit, certain optimizations may be possible.
319
320 %\subsection{Life Cycle of an Instruction}
321 %
322 %The diagram below shows an input dock for purposes of illustration:
323 %
324 %\begin{center}
325 %\epsfig{file=in,width=4in}\\
326 %{\it an input dock}
327 %\end{center}
328 %
329 %\color{black}
330 %
331 %\begin{center}
332 %\epsfig{file=out,width=4in}\\
333 %{\it an output dock}
334 %\end{center}
335
336 %\subsection{Format of an Instruction}
337 %
338 %All instruction words have the following format:
339 %
340 \newcommand{\bitsHeader}{
341   \bitbox{1}{I} 
342   \bitbox{3}{P} 
343 }
344 \newcommand{\bitsHeaderNoI}{
345   \bitbox{1}{} 
346   \bitbox{3}{P} 
347 }
348 %
349 %
350 %The {\tt P} bits are a {\it predicate}; this holds a code which
351 %indicates if the instruction should be executed or ignored depending
352 %on the state of flags in the dock.  Note that {\tt head} and {\tt
353 %tail} instructions do not have {\tt P} fields.
354
355
356 \subsection{Loop Counters}
357
358 A programmer can perform two types of loops: {\it inner} loops
359 consisting of only one {\tt move} instruction and {\it outer} loops of
360 multiple instructions of any type.  Inner loops may be nested within
361 an outer loop, but no other nesting of loops is allowed.
362
363 The dock has two loop counters, one for each kind of loop:
364
365 \begin{itemize}
366 \item {\tt OLC} is the Outer Loop Counter
367 \item {\tt ILC} is the Inner Loop Counter
368 \end{itemize}
369
370 The {\tt OLC} applies to all instructions and can hold integers {\tt
371   0..MAX_OLC} (63).
372
373 The {\tt ILC} applies only to {\tt move} instructions and can hold
374 integers {\tt 0..MAX_ILC} (63) as well as a special value: $\infty$.  When
375 {\tt ILC=0} the next {\tt move} instruction executes zero times (ie is
376 ignored).  When {\tt ILC=$\infty$} the next {\tt move} instruction
377 executes until interrupted by a torpedo.  After every {\tt move}
378 instruction the {\tt ILC} is reset to {\tt 1} (note that it is reset
379 to {\tt 1}, {\it not to 0}).
380
381 \color{black}
382 \subsection{Flags}
383
384 The dock has four flags: {\tt A}, {\tt B},
385 {\tt C}, and {\tt D}.
386
387 \begin{itemize}
388 \item The {\tt A} and {\tt B} flags are general-purpose flags which
389       may be set and cleared by the programmer.
390
391 %\item
392 %
393 % The {\tt L} flag, known as the {\it last} flag, is set whenever
394 %      the value in the outer counter ({\tt OLC}) is one,
395 \color{black}
396 % indicating
397 %      that the dock is in the midst of the last iteration of an
398 %      outer loop.  This flag can be used to perform certain
399 %      operations (such as sending a completion token) only on the last
400 %      iteration of an outer loop.
401
402 \item The {\tt C} flag is known as the {\it control} flag, and may be
403       set by the {\tt move} instruction based on information from the
404       ship or from an inbound packet.  See the {\tt move} instruction
405       for further details.
406
407 \item The {\tt D} flag is known as the {\it done} flag.  The {\tt D}
408       flag is {\it set} when the {\tt OLC} is zero immediately after
409       execution of a {\tt set olc} or {\tt decrement olc} instruction,
410       or when a torpedo strikes.  The {\tt D} flag is {\it cleared}
411       when a {\tt set olc} instruction causes the {\tt OLC} to be
412       loaded with a nonzero value.
413
414 \color{black}
415
416 \end{itemize}
417
418 \subsection{Predication}
419
420 All instructions except for {\tt head} and {\tt tail} have a three-bit
421 field marked {\tt P}, which specifies a {\it predicate}.
422
423 \begin{center}
424 \setlength{\bitwidth}{5mm}
425 {\tt{\footnotesize{
426 \begin{bytefield}{25}
427   \bitheader[b]{0,20,21,23-24}\\
428   \bitsHeaderNoI
429   \bitbox[tbr]{21}{} 
430 \color{black}
431 \end{bytefield}}}}
432 \end{center}
433
434 The predicate determines which conditions must be true in order for
435 the instruction to execute; if it is not executed, it is simply {\it
436   ignored}.  The table below shows what conditions must be true in
437 order for an instruction to execute:
438
439 \begin{center}
440 \begin{tabular}{|r|l|}\hline
441 Code       & Execute if \\\hline
442 {\tt 000:} & {\tt D=0}\   and {\tt A=0} \\
443 {\tt 001:} & {\tt D=0}\   and {\tt A=1} \\
444 {\tt 010:} & {\tt D=0}\   and {\tt B=0} \\
445 {\tt 011:} & {\tt D=0}\   and {\tt B=1} \\
446 {\tt 100:} & Unused  \\
447 {\tt 101:} & {\tt D=1}\   \\
448 {\tt 110:} & {\tt D=0}\   \\
449 {\tt 111:} & always  \\
450 \hline\end{tabular}
451 \end{center}
452
453 \pagebreak
454
455 \begin{wrapfigure}{r}{40mm}
456   \begin{center}
457 \epsfig{file=requeue,height=1.5in}\\
458   \end{center}
459   \caption{{\it the requeue stage}}
460 \end{wrapfigure}
461
462 \subsection{The Requeue Stage}
463
464 The requeue stage has two inputs, which will be referred to as the
465 {\it enqueueing} input and the {\it recirculating} input.  It has a
466 single output which feeds into the instruction fifo.
467
468 The requeue stage has two states: {\sc Updating} and {\sc
469   Circulating}.
470
471 \subsubsection{The {\sc Updating} State}
472
473 On initialization, the dock is in the {\sc Updating} state.  In this
474 state the requeue stage is performing three tasks:
475 \begin{itemize}
476 \item it is draining the
477 previous loop's instructions (if any) from the fifo
478 \item it is executing any ``one
479 shot'' instructions which come between the previous loop's {\tt tail}
480 and the next loop's {\tt head}
481 \item it is loading the instructions of
482 the next loop into the fifo.
483 \end{itemize}
484
485 In the {\sc Updating} state, the requeue stage will accept any
486 instruction other than a {\tt tail} which arrives at its {\it
487   enqueueing} input, and pass this instruction to its output.  Any
488 instruction other than a {\tt head} which arrives at the {\it
489   recirculating} input will be discarded.
490
491 Note that when a {\tt tail} instruction arrives at the {\it
492   enqueueing} input, it ``gets stuck'' there.  Likewise, when a {\tt
493   head} instruction arrives at the {\it recirculating} input, it also
494 ``gets stuck''.  When the requeue stage finds {\it both} a {\tt tail}
495 instruction stuck at the {\it enqueueing} input and a {\tt head}
496 instruction stuck at the {\it recirculating} input, the requeue stage
497 discards both the {\tt head} and {\tt tail} and transitions to the
498 {\sc Circulating} state.
499
500 \subsubsection{The {\sc Circulating} State}
501
502 In the {\sc Circulating} state, the dock repeatedly executes the set
503 of instructions that are in the instruction fifo.
504
505 In the {\sc Circulating} state, the requeue stage will not accept
506 items from its {\it enqueueing} input.  Any item presented at the {\it
507   recirculating} input will be passed through to the requeue stage's
508 output.
509
510 When an {\tt abort} instruction is executed, the requeue stage
511 transitions back to the {\sc Updating} state.  Note that {\tt abort}
512 instructions include a predicate; an {\tt abort} instruction whose
513 predicate is not met will not cause this transition.
514
515 \color{black}
516
517
518 \pagebreak
519 \section{Instructions}
520
521 %The dock supports four instructions:
522 %{\tt move} (variants: {\tt moveto}, {\tt dispatch}),
523 %{\tt shift},
524 %{\tt set}, and
525 %{\tt tail}.
526 %\color{black}
527
528
529 \subsection{{\tt move}}
530
531 \newcommand{\bitsMove}{\setlength{\bitwidth}{5mm}
532 {\tt
533 \begin{bytefield}{25}
534   \bitheader[b]{14-20}\\
535 \color{light}
536   \bitsHeader
537 \color{black}
538   \bitbox{1}{0} 
539   \bitbox{1}{1} 
540   \bitbox{1}{\tt Ti}
541   \bitbox{1}{\tt Di}
542   \bitbox{1}{\tt Dc}
543   \bitbox{1}{\tt Do}
544   \bitbox{1}{\tt To}
545   \bitbox[l]{19}{}
546 \end{bytefield}}
547
548 \begin{bytefield}{25}
549   \bitheader[b]{0,12,13}\\
550   \bitbox[1]{10}{\raggedleft {\tt moveto} ({\tt Immediate\to Path})}
551   \bitbox[r]{1}{}
552   \bitbox{1}{\tt 1}
553   \bitbox{13}{\tt Immediate}
554 \end{bytefield}
555
556 \begin{bytefield}{25}
557   \bitheader[b]{11,12,13}\\
558   \bitbox[1]{10}{\raggedleft {\tt dispatch} ({\footnotesize {\tt DataPredecessor[37:26\color{black}]\to Path}})\ \ }
559   \bitbox[r]{1}{}
560   \bitbox{1}{\tt 0}
561   \bitbox{1}{\tt 1}
562 \color{light}
563   \bitbox[trb]{12}{}
564 \color{black}
565 \end{bytefield}
566
567 \begin{bytefield}{25}
568   \bitheader[b]{11,12,13}\\
569   \bitbox[1]{10}{\raggedleft {\tt move} ({\tt Path} unchanged):}
570   \bitbox[r]{1}{}
571   \bitbox{1}{\tt 0}
572   \bitbox{1}{\tt 0}
573 \color{light}
574   \bitbox[trb]{12}{}
575 \color{black}
576 \end{bytefield}}
577 \bitsMove
578
579 \begin{itemize}
580 \item {\tt Ti} - Token Input: wait for the token predecessor to be full and drain it.
581 \item {\tt Di} - Data Input: wait for the data predecessor to be full and drain it.
582 \item {\tt Dc} - Data Capture: pulse the data latch.
583 \item {\tt Do} - Data Output: fill the data successor.
584 \item {\tt To} - Token Output: fill the token successor.
585 \end{itemize}
586
587 The data successor and token successor must both be empty in order for
588 a {\tt move} instruction to attempt execution.
589
590 The {\tt I} bit stands for {\tt Immune}, and indicates if the
591 instruction is immune to torpedoes.
592
593 Every time the {\tt move} instruction executes, the {\tt C} flag is
594 be set:
595
596 \begin{itemize}
597 \item If the dock is an {\it output} and the instruction has the {\tt
598   Dc} bit set, the {\tt C} flag is set to a value provided by the
599   ship.
600
601 \item Otherwise, if {\tt Ti=1} at any kind of dock or {\tt Di=1} at an
602   input dock, the {\tt C} flag is set to the signal bit of the
603   incoming packet.
604
605 \item Otherwise, the signal bit is set to an undefined value.
606
607 \end{itemize}
608 \color{black}
609
610 The {\tt flush} instruction is a variant of {\tt move} which is valid
611 only at input docks.  It has the same effect as {\tt deliver}, except
612 that it sets a special ``flushing'' indicator along with the data
613 being delivered.
614
615 \newcommand{\bitsFlush}{\setlength{\bitwidth}{5mm}
616 {\tt
617 \begin{bytefield}{25}
618   \bitheader[b]{14-18}\\
619   \bitbox[r]{6}{\raggedleft{\tt flush\ \ }}
620   \bitbox{1}{\tt 0}
621 \color{black}
622   \bitbox{1}{\tt 0}
623   \bitbox{1}{\tt 1}
624 \color{light}
625   \bitbox{1}{\tt 0}
626   \bitbox{1}{\tt 0}
627   \bitbox{14}{}
628 \end{bytefield}}}
629 \bitsFlush
630
631 When a ship fires, it must examine the ``flushing'' indicators on the
632 input docks whose fullness was part of the firing condition.  If all
633 of the input docks' flushing indicators are set, the ship must drain
634 all of their data successors and take no action.  If some, but not
635 all, of the indicators are set, the ship must drain {\it only the data
636   successors of the docks whose indicators were {\bf not} set}, and
637 take no action.  If none of the flushing indicators was set, the ship
638 fires normally.
639
640 \color{black}
641
642 \pagebreak
643
644 \subsection{{\tt set}}
645
646 The {\tt set} command is used to set or decrement the inner loop
647 counter, outer loop counter, and data latch.
648
649 \newcommand{\bitsSet}{
650 {\tt
651 \begin{bytefield}{25}
652   \bitheader[b]{19-24}\\
653   \bitsHeaderNoI
654   \bitbox{1}{1}
655   \bitbox{1}{0} 
656 \color{light}
657   \bitbox{4}{Dest} 
658   \bitbox{3}{Src} 
659   \bitbox{12}{} 
660 \color{black}
661 \end{bytefield}}
662
663 \begin{bytefield}{25}
664   \bitheader[b]{0,5,12-18}\\
665   \bitbox[1]{5}{\raggedleft {\tt Immediate}\to{\tt OLC}}
666   \bitbox[r]{1}{}
667   \bitbox{4}{\tt 1000\color{black}}
668   \bitbox{3}{\tt 100}
669   \bitbox{6}{}
670   \bitbox{6}{\tt Immediate}
671 \end{bytefield}
672
673 \begin{bytefield}{25}
674   \bitheader[b]{12-18}\\
675   \bitbox[1]{5}{\raggedleft {\tt Data Latch}\to{\tt OLC}}
676   \bitbox[r]{1}{}
677   \bitbox{4}{\tt 1000\color{black}}
678   \bitbox{3}{\tt 010}
679   \bitbox{12}{}
680 \end{bytefield}
681
682 \begin{bytefield}{25}
683   \bitheader[b]{12-18}\\
684   \bitbox[1]{5}{\raggedleft {\tt OLC-1}\to{\tt OLC}}
685   \bitbox[r]{1}{}
686   \bitbox{4}{\tt 1000\color{black}}
687   \bitbox{3}{\tt 001}
688   \bitbox{12}{}
689 \end{bytefield}
690
691 \begin{bytefield}{25}
692   \bitheader[b]{0,5,6,12-18}\\
693   \bitbox[1]{5}{\raggedleft {\tt Immediate}\to{\tt ILC}}
694   \bitbox[r]{1}{}
695   \bitbox{4}{\tt 0100\color{black}}
696   \bitbox{3}{\tt 100}
697   \bitbox{5}{}
698   \bitbox{1}{\tt 0}
699   \bitbox{6}{\tt Immediate}
700 \end{bytefield}
701
702 \begin{bytefield}{25}
703   \bitheader[b]{6,12-18}\\
704   \bitbox[1]{5}{\raggedleft $\infty$\to{\tt ILC}}
705   \bitbox[r]{1}{}
706   \bitbox{4}{\tt 0100\color{black}}
707   \bitbox{3}{\tt 100}
708   \bitbox{5}{}
709   \bitbox{1}{\tt 1}
710   \bitbox{6}{}
711 \end{bytefield}
712
713 \begin{bytefield}{25}
714   \bitheader[b]{12-18}\\
715   \bitbox[1]{5}{\raggedleft {\tt Data Latch}\to{\tt ILC}}
716   \bitbox[r]{1}{}
717   \bitbox{4}{\tt 0100\color{black}}
718   \bitbox{3}{\tt 010}
719   \bitbox{12}{}
720 \end{bytefield}
721
722 \begin{bytefield}{25}
723   \bitheader[b]{0,13-18}\\
724   \bitbox[1]{5}{\raggedleft \footnotesize {\tt Sign-Extended Immediate}\to{\tt Data Latch}}
725   \bitbox[r]{1}{}
726   \bitbox{4}{\tt 0010\color{black}}
727   \bitbox{1}{\begin{minipage}{0.5cm}{
728 \begin{center}
729 \tt{\footnotesize{Si
730
731 \vspace{-2mm}gn}}
732 \end{center}}
733 \end{minipage}}
734   \bitbox{14}{\tt Immediate}
735 \end{bytefield}
736
737 \begin{bytefield}{25}
738   \bitheader[b]{0,5,6,11,15-18}\\
739   \bitbox[1]{5}{\raggedleft {\tt Update Flags}}
740   \bitbox[r]{1}{}
741   \bitbox{4}{\tt 0001\color{black}}
742   \bitbox{3}{}
743   \bitbox{6}{\tt nextA}
744   \bitbox{6}{\tt nextB}
745 \end{bytefield}
746 \color{black}
747 }
748 \bitsSet
749
750 The Marina implementation has an unarchitected
751 ``literal latch'' at the on deck ({\tt OD}) stage, which is loaded
752 with the possibly-extended literal {\it at the time that the {\tt set}
753   instruction comes on deck}.  This latch is then copied into the data
754 latch when a {\tt set Data Latch} instruction
755 executes.
756
757 The {\tt Sign-Extended Immediate} instruction copies the {\tt
758 Immediate} field into the least significant bits of the data latch.
759 All other bits of the data latch are filled with a copy of the
760 bit marked ``{\tt Sign}.''
761 \color{black}
762
763 Each of the {\tt nextA} and {\tt nextB} fields has the following
764 structure, and indicates which old flag values should be logically
765 {\tt OR}ed together to produce the new flag value:
766
767 \begin{center}
768 {\tt
769 \begin{bytefield}{6}
770   \bitheader[b]{0-5}\\
771   \bitbox{1}{${\text{\tt A}}$}
772   \bitbox{1}{$\overline{\text{\tt A}}$}
773   \bitbox{1}{${\text{\tt B}}$}
774   \bitbox{1}{$\overline{\text{\tt B}}$}
775   \bitbox{1}{${\text{{\tt C}\ }}$}
776   \bitbox{1}{$\overline{\text{{\tt C}\ }}$}
777 \end{bytefield}}
778 \end{center}
779
780 Each bit corresponds to one possible input; all inputs whose bits are
781 set are {\tt OR}ed together, and the resulting value is assigned to
782 the flag.  Note that if none of the bits are set, the value assigned
783 is zero.  Note also that it is possible to produce a {\tt 1} by {\tt
784   OR}ing any flag with its complement, and that {\tt set Flags} can
785 be used to create a {\tt nop} (no-op) by setting each flag to itself.
786
787
788 \color{black}
789
790 \pagebreak
791 \subsection{{\tt shift}}
792
793 \newcommand{\shiftImmediateSize}{19}
794
795 Each {\tt shift} instruction carries an immediate of \shiftImmediateSize\ 
796 bits.  When a {\tt shift} instruction is executed, this immediate is copied
797 into the least significant \shiftImmediateSize\  bits of the data latch,
798 and the remaining most significant bits of the data latch are loaded
799 with the value formerly in the least significant bits of the data latch.
800 In this manner, large literals can be built up by ``shifting'' them
801 into the data latch \shiftImmediateSize\ bits at a time.
802
803 \newcommand{\bitsShift}{
804 \setlength{\bitwidth}{5mm}
805 {\tt
806 \begin{bytefield}{25}
807   \bitheader[b]{0,18-20}\\
808 \color{light}
809   \bitsHeaderNoI
810 \color{black}
811   \bitbox{1}{0} 
812   \bitbox{1}{0} 
813 \color{black}
814   \bitbox{\shiftImmediateSize}{Immediate} 
815 \end{bytefield}}
816 }
817 \bitsShift
818
819 The Marina implementation has an unarchitected
820 ``literal latch'' at the on deck ({\tt OD}) stage, which is loaded
821 with the literal {\it at the time that the {\tt shift} instruction
822   comes on deck}.  This latch is then copied into the data latch when
823 the instruction executes.
824
825 \color{black}
826
827 \subsection{{\tt abort}}
828 \newcommand{\bitsAbort}{\setlength{\bitwidth}{5mm}
829 {\tt
830 \begin{bytefield}{25}
831   \bitheader[b]{17-20}\\
832 \color{light}
833   \bitsHeaderNoI
834 \color{black}
835   \bitbox{1}{1} 
836   \bitbox{1}{1} 
837   \bitbox{1}{0} 
838   \bitbox{1}{0} 
839 \color{light}
840   \bitbox[tbr]{17}{}
841 \end{bytefield}}}
842 \bitsAbort
843
844 An {\tt abort} instruction causes a loop to exit; see the section on
845 the Requeue Stage for further details.
846
847 \subsection{{\tt head}}
848 \newcommand{\bitsHead}{
849 \setlength{\bitwidth}{5mm}
850 {\tt
851 \begin{bytefield}{25}
852   \bitheader[b]{17-20}\\
853 \color{light}
854   \bitbox{4}{} 
855 \color{black}
856   \bitbox{1}{1}
857   \bitbox{1}{1}
858   \bitbox{1}{1}
859   \bitbox{1}{0}
860 \color{light}
861   \bitbox[tbr]{17}{} 
862 \end{bytefield}}}
863 \bitsHead
864
865 A {\tt head} instruction marks the start of a loop; see the section on
866 the Requeue Stage for further details.
867
868 \color{black}
869 \subsection{{\tt tail}}
870 \newcommand{\bitsTail}{
871 \setlength{\bitwidth}{5mm}
872 {\tt
873 \begin{bytefield}{25}
874   \bitheader[b]{17-20}\\
875 \color{light}
876   \bitbox{4}{} 
877 \color{black}
878   \bitbox{1}{1}
879   \bitbox{1}{1}
880   \bitbox{1}{1}
881   \bitbox{1}{1}
882 \color{light}
883   \bitbox[tbr]{17}{} 
884 \end{bytefield}}}
885 \bitsTail
886
887 A {\tt tail} instruction marks the end of a loop; see the section on
888 the Requeue Stage for further details.
889
890 \color{black}
891 %\pagebreak
892 %\subsection{{\tt takeOuterLoopCounter}}
893 %
894 %\setlength{\bitwidth}{5mm}
895 %{\tt
896 %\begin{bytefield}{25}
897 %  \bitheader[b]{16-19,21}\\
898 %\color{light}
899 %  \bitbox{1}{A}
900 %  \bitbox{1}{OS} 
901 %  \bitbox{2}{P}
902 %\color{black}
903 %  \bitbox{3}{000}
904 %  \bitbox{1}{0}
905 %  \bitbox{2}{11}
906 %\color{light}
907 %  \bitbox[tbr]{16}{} 
908 %\color{black}
909 %\end{bytefield}}
910 %
911 %This instruction copies the value in the outer loop counter {\tt OLC}
912 %into the least significant bits of the data latch and leaves all other
913 %bits of the data latch unchanged.
914 %
915 %\subsection{{\tt takeInnerLoopCounter}}
916 %
917 %\setlength{\bitwidth}{5mm}
918 %{\tt
919 %\begin{bytefield}{25}
920 %  \bitheader[b]{16-19,21}\\
921 %\color{light}
922 %  \bitbox{1}{A}
923 %  \bitbox{1}{OS} 
924 %  \bitbox{2}{P}
925 %\color{black}
926 %  \bitbox{3}{???}
927 %  \bitbox{1}{?}
928 %  \bitbox{2}{??}
929 %\color{light}
930 %  \bitbox[tbr]{16}{} 
931 %\color{black}
932 %\end{bytefield}}
933 %
934 %This instruction copies the value in the inner loop counter {\tt ILC}
935 %into the least significant bits of the data latch and leaves all other
936 %bits of the data latch unchanged.
937 %
938 %
939 %
940 %%\pagebreak
941 %%\subsection{{\tt interrupt}}
942 %%
943 %%\setlength{\bitwidth}{5mm}
944 %{\tt
945 %\begin{bytefield}{25}
946 %  \bitheader[b]{0,5,16-19,21}\\
947 %\color{light}
948 %  \bitbox{4}{} 
949 %\color{black}
950 %  \bitbox{3}{000} 
951 %  \bitbox{1}{1}
952 %  \bitbox{2}{00}
953 %\color{light}
954 %  \bitbox[tbr]{16}{} 
955 %\end{bytefield}}
956 %
957 %When an {\tt interrupt} instruction reaches {\tt IH}, it will wait
958 %there for the {\tt OD} stage to be full with an instruction that has
959 %the {\tt IM} bit set.  When this occurs, the instruction at {\tt OD}
960 %{\it will not execute}, but {\it may reloop} if the conditions for
961 %relooping are met.
962 %\footnote{The ability to interrupt an instruction yet have it reloop is very
963 %useful for processing chunks of data with a fixed size header and/or
964 %footer and a variable length body.}
965 %
966 %
967 %\subsection{{\tt massacre}}
968 %
969 %\setlength{\bitwidth}{5mm}
970 %{\tt
971 %\begin{bytefield}{25}
972 %  \bitheader[b]{16-19,21}\\
973 %\color{light}
974 %  \bitbox{4}{} 
975 %\color{black}
976 %  \bitbox{3}{000} 
977 %  \bitbox{1}{1}
978 %  \bitbox{2}{01}
979 %\color{light}
980 %  \bitbox[tbr]{16}{} 
981 %\color{black}
982 %\end{bytefield}}
983 %
984 %When a {\tt massacre} instruction reaches {\tt IH}, it will wait there
985 %for the {\tt OD} stage to be full with an instruction that has the
986 %{\tt IM} bit set.  When this occurs, all instructions in the
987 %instruction fifo (including {\tt OD}) are retired.
988 %
989 %\subsection{{\tt clog}}
990 %
991 %\setlength{\bitwidth}{5mm}
992 %{\tt
993 %\begin{bytefield}{25}
994 %  \bitheader[b]{16-19,21}\\
995 %\color{light}
996 %  \bitbox{4}{} 
997 %\color{black}
998 %  \bitbox{3}{000} 
999 %  \bitbox{1}{1}
1000 %  \bitbox{2}{10}
1001 %\color{light}
1002 %  \bitbox[tbr]{16}{} 
1003 %\color{black}
1004 %\end{bytefield}}
1005 %
1006 %When a {\tt clog} instruction reaches {\tt OD}, it remains there and
1007 %no more instructions will be executed until an {\tt unclog} is
1008 %performed.
1009 %
1010 %\subsection{{\tt unclog}}
1011 %
1012 %\setlength{\bitwidth}{5mm}
1013 %{\tt
1014 %\begin{bytefield}{25}
1015 %  \bitheader[b]{16-19,21}\\
1016 %\color{light}
1017 %  \bitbox{4}{} 
1018 %\color{black}
1019 %  \bitbox{3}{000} 
1020 %  \bitbox{1}{1}
1021 %  \bitbox[lrtb]{2}{11}
1022 %\color{light}
1023 %  \bitbox[tbr]{16}{} 
1024 %\color{black}
1025 %\end{bytefield}}
1026 %
1027 %When an {\tt unclog} instruction reaches {\tt IH}, it will wait there
1028 %until a {\tt clog} instruction is at {\tt OD}.  When this occurs, both
1029 %instructions retire.
1030 %
1031 %Note that issuing an {\tt unclog} instruction to a dock which is not
1032 %clogged and whose instruction fifo contains no {\tt clog} instructions
1033 %will cause the dock to deadlock.
1034
1035 \pagebreak
1036 \section*{Errata}
1037
1038 The following additional restrictions have been imposed on the dock in
1039 the Marina test chip:
1040
1041 \subsection*{Both Docks}
1042
1043 \begin{enumerate}
1044
1045 \item
1046 A Marina dock initializes with the {\tt ILC}, {\tt OLC}, and flags in
1047 an indeterminate state.
1048
1049 \item
1050 The instruction immediately after a {\tt move} instruction must not be
1051 a {\tt set flags} instruction which utilizes the {\tt C}-flag (the
1052 value of the {\tt C}-flag is not stable for a brief time after a {\tt
1053   move}).
1054
1055 \item
1056 If a {\tt move} instruction is torpedoable (ie it has the {\tt I} bit
1057 set to {\tt 0}), it {\it must} have either the {\tt Ti} bit or {\tt
1058   Di} bit set (or both).  It is not permitted for a torpedoable {\tt
1059   move} to have both bits cleared.
1060
1061 \end{enumerate}
1062
1063
1064 \subsection*{Dock with Ivan's Counter (non-stretch)}
1065
1066 \begin{enumerate}
1067
1068 \item
1069
1070 A torpedoable {\tt move} instruction must not be followed immediately
1071 by a {\tt set olc} instruction or another torpedoable {\tt move}.
1072
1073 \item
1074
1075 This document specifies that when a torpedoable {\tt move} instruction
1076 executes successfully, the {\tt D} flag is unchanged.  In Marina, when
1077 a torpedoable {\tt move} instruction executes successfully, it causes
1078 the {\tt D} flag to be set if the {\tt OLC} was zero and causes it to
1079 be cleared if the {\tt OLC} was nonzero.  Thus, in the following
1080 instruction sequence:
1081
1082   \begin{verbatim}
1083   head;
1084   [*] set olc=1;
1085       send token to self:i;
1086   [T] recv token;
1087   [*] send token to self;
1088   [T] recv token;
1089   [*] abort;
1090   tail;
1091   \end{verbatim}
1092
1093 Will leave the {\tt D} flag {\it set} on Marina, whereas a strict
1094 implementation of this document would leave it cleared.
1095
1096 In practice, this distinction rarely matters.
1097
1098 \end{enumerate}
1099
1100 \subsection*{Dock with Kessels Counter (``stretch'')}
1101
1102 With the Kessels counter, the {\tt D}-flag {\it is exactly equal to}
1103 the zeroness of the {\tt OLC}; it cannot be ``out of sync'' with it.
1104
1105 \begin{enumerate}
1106
1107 \item
1108 Every ``load OLC'' instruction must be predicated on the {\tt D}-flag
1109 being {\it set}.  This is a sneaky way of forcing the programmer to
1110 ``run down'' the counter before loading it, because Kessels' counter
1111 does not support ``unloading.''
1112
1113 \item
1114 Every ``decrement OLC'' instruction must be predicated on the {\tt
1115   D}-flag being {\it cleared}.  This way we never have to check if the
1116 counter is already empty before decrementing.
1117
1118 \item
1119 The instruction after a torpedoable {\tt move} must not be predicated
1120 on the {\tt D}-flag being {\it set} (it may be predicated on the {\tt
1121   D}-flag being {\it cleared}.  This is because, while the move
1122 instruction is waiting to execute, the {\tt D}-flag will be cleared,
1123 and the predicate stage believes that it can skip the instruction even
1124 though {\tt do[ins]} is still high (I think this is dumb).
1125
1126
1127 \end{enumerate}
1128
1129 \color{black}
1130
1131 \pagebreak
1132 \section*{External Instruction Encoding Map\color{black}}
1133
1134
1135 \vspace{3mm}\hspace{-1cm}{\tt shift}\hspace{1cm}\vspace{-6mm}\\
1136 \bitsShift
1137
1138 \vspace{3mm}\hspace{-1cm}{\tt set}\hspace{1cm}\vspace{-6mm}\\
1139 \bitsSet
1140
1141 \vspace{3mm}\hspace{-1cm}{\tt move}\hspace{1cm}\vspace{-6mm}\\
1142 \bitsMove
1143 \bitsFlush
1144
1145 \vspace{3mm}\hspace{-1cm}{\tt abort}\hspace{1cm}\vspace{-6mm}\\
1146 \bitsAbort
1147
1148 \vspace{3mm}\hspace{-1cm}{\tt head}\hspace{1cm}\vspace{-6mm}\\
1149 \bitsHead
1150
1151 \vspace{3mm}\hspace{-1cm}{\tt tail}\hspace{1cm}\vspace{-6mm}\\
1152 \bitsTail
1153
1154
1155 %\pagebreak
1156 %\epsfig{file=all,height=5in,angle=90}
1157
1158 %\pagebreak
1159 %\subsection*{Input Dock}
1160 %\epsfig{file=in,width=8in,angle=90}
1161
1162 %\pagebreak
1163 %\subsection*{Output Dock}
1164 %\epsfig{file=out,width=8in,angle=90}
1165
1166
1167 %\pagebreak
1168 %\epsfig{file=ports,height=5in,angle=90}
1169
1170 %\pagebreak
1171 %\epsfig{file=best,height=5in,angle=90}
1172
1173 \pagebreak
1174 \section*{Internal Instruction Encoding Map\color{black}}
1175
1176 Marina Instructions in main memory occupy 37 bits.  Of this, 11 bits
1177 give the path to the dock which is to execute the instruction; thus,
1178 only 26 of these bits are interpreted by the dock.
1179
1180 It is easiest to design the OD and EX stages of the dock if the
1181 control bits supplied there are mostly one-hot encoded.  Moreover, due
1182 to layout considerations there is very little cost associated with
1183 making the instruction fifo 36 bits wide rather than 26 bits wide.
1184
1185 Due to these two considerations, all 26-bit instructions
1186 binary-coded-control instructions are expanded into 36-bit
1187 unary-coded-control instructions upon entry to the instruction fifo.
1188 This section documents the 36-bit unary-coded-control format.
1189
1190 \subsection*{Predicate Field}
1191
1192 The {\tt Predicate} field, common to many instructions, consists of a
1193 six-bit wide, one-hot encoded field.  The instruction will be {\bf
1194   skipped} (not executed) if {\bf any} condition corresponding to a
1195 bit whose value is one is met.
1196
1197 \setlength{\bitwidth}{3.5mm}
1198 {\footnotesize\tt\begin{bytefield}{36}
1199   \bitheader[b]{0,29-35}\\
1200 \color{black}
1201   \bitbox{1}{D}
1202   \bitbox{1}{!D}
1203   \bitbox{1}{!B}
1204   \bitbox{1}{B}
1205   \bitbox{1}{!A}
1206   \bitbox{1}{A}
1207 \color{light}
1208   \bitbox{30}{}
1209 \end{bytefield}}
1210
1211 For example, if bits 31 and 34 are set, the instruction will be
1212 skipped if either the {\tt B} flag is cleared or the {\tt A} flag is
1213 set.  Equivalently, it will be executed iff the {\tt B} flag is set
1214 and the {\tt A} flag is cleared.
1215
1216 \subsection*{Set Flags}
1217
1218 Each of the {\tt FlagA} and {\tt FlagB} fields in the Set Flags
1219 instruction gives a truth table; the new value of the flag is the
1220 logical OR of the inputs whose bits are set to {\tt 1}.
1221
1222 \setlength{\bitwidth}{5mm}
1223 {\tt\begin{bytefield}{6}
1224   \bitheader[b]{0-5}\\
1225 \color{black}
1226   \bitbox{1}{!C}
1227   \bitbox{1}{C}
1228   \bitbox{1}{!B}
1229   \bitbox{1}{B}
1230   \bitbox{1}{!A}
1231   \bitbox{1}{A}
1232 \end{bytefield}}
1233
1234 \newcommand{\common}{%
1235 \bitbox{6}{Predicate}%
1236 }
1237
1238 \pagebreak
1239 \pagestyle{plain}
1240 \pdfpagewidth 8.5in
1241 \pdfpageheight 11in 
1242 \textheight 7.9in
1243 \textwidth 7.0in
1244 \oddsidemargin 0.9in
1245 %\headwidth 6.0in
1246
1247 \begin{sidewaysfigure}[h!]
1248 %\begin{landscape}
1249
1250 \setlength{\bitwidth}{5mm}
1251 \begin{tabular}{lr}
1252 \\
1253 Shift &
1254 {\tt\begin{bytefield}{36}
1255   \bitheader[b]{0,18,19,21-30,35}\\
1256 \common 
1257 \color{light}
1258   \bitbox{3}{} 
1259 \color{black}
1260   \bitbox{1}{1} 
1261 \color{light}
1262   \bitbox{1}{} 
1263   \bitbox{1}{} 
1264   \bitbox{1}{} 
1265   \bitbox{1}{} 
1266   \bitbox{1}{} 
1267   \bitbox{1}{} 
1268 \color{black}
1269   \bitbox{1}{1}
1270   \bitbox{19}{immediate} 
1271 \end{bytefield}} \\
1272 Set Data Latch &
1273 {\tt\begin{bytefield}{36}
1274   \bitheader[b]{0,13,14,15,21-30,35}\\
1275 \common 
1276 \color{light}
1277   \bitbox{3}{} 
1278 \color{black}
1279   \bitbox{1}{1} 
1280 \color{light}
1281   \bitbox{1}{} 
1282   \bitbox{1}{} 
1283   \bitbox{1}{} 
1284   \bitbox{1}{} 
1285   \bitbox{1}{} 
1286   \bitbox{1}{}
1287 \color{black}
1288   \bitbox{1}{0}
1289 \color{light}
1290   \bitbox{4}{}
1291 \color{black}
1292   \bitbox{1}{+-} 
1293   \bitbox{14}{immediate to sign ext} 
1294 \end{bytefield}} \\\hline
1295 \\
1296 Move, Immediate$\rightarrow$Path &
1297 {\tt\begin{bytefield}{36}
1298   \bitheader[b]{0,13,14-20,21-30,35}\\
1299 \common
1300 \color{light}
1301   \bitbox{3}{} 
1302   \bitbox{1}{} 
1303 \color{black}
1304   \bitbox{1}{Tp} 
1305   \bitbox{1}{1} 
1306 \color{light}
1307   \bitbox{1}{} 
1308   \bitbox{1}{} 
1309   \bitbox{1}{} 
1310 \color{black}
1311   \bitbox{1}{rD}
1312 \color{light}
1313   \bitbox{1}{} 
1314 \color{black}
1315   \bitbox{1}{Ti}
1316   \bitbox{1}{Di} 
1317   \bitbox{1}{Dc} 
1318   \bitbox{1}{Do} 
1319   \bitbox{1}{To} 
1320   \bitbox{1}{1} 
1321   \bitbox{13}{Immediate} 
1322 \end{bytefield}} \\
1323 Move, DP[37:26]$\rightarrow$Path &
1324 {\tt\begin{bytefield}{36}
1325   \bitheader[b]{0,12-13,14-20,21-30,35}\\
1326 \common
1327 \color{light}
1328   \bitbox{3}{} 
1329   \bitbox{1}{} 
1330 \color{black}
1331   \bitbox{1}{Tp} 
1332   \bitbox{1}{1} 
1333 \color{light}
1334   \bitbox{1}{} 
1335   \bitbox{1}{} 
1336   \bitbox{1}{} 
1337 \color{black}
1338   \bitbox{1}{rD}
1339 \color{light}
1340   \bitbox{1}{} 
1341 \color{black}
1342   \bitbox{1}{Ti}
1343   \bitbox{1}{Di} 
1344   \bitbox{1}{Dc} 
1345   \bitbox{1}{Do} 
1346   \bitbox{1}{To} 
1347   \bitbox{1}{0} 
1348   \bitbox{1}{0} 
1349 \color{light}
1350   \bitbox{12}{} 
1351 \end{bytefield}} \\
1352 Move, Path unchanged &
1353 {\tt\begin{bytefield}{36}
1354   \bitheader[b]{0,11-13,14-20,21-30,35}\\
1355 \common
1356 \color{light}
1357   \bitbox{3}{} 
1358   \bitbox{1}{} 
1359 \color{black}
1360   \bitbox{1}{Tp} 
1361   \bitbox{1}{1} 
1362 \color{light}
1363   \bitbox{1}{} 
1364   \bitbox{1}{} 
1365   \bitbox{1}{} 
1366 \color{black}
1367   \bitbox{1}{rD}
1368 \color{light}
1369   \bitbox{1}{} 
1370 \color{black}
1371   \bitbox{1}{Ti}
1372   \bitbox{1}{Di} 
1373   \bitbox{1}{Dc} 
1374   \bitbox{1}{Do} 
1375   \bitbox{1}{To} 
1376   \bitbox{1}{0} 
1377   \bitbox{1}{1} 
1378   \bitbox{1}{F$\dagger$} 
1379 \color{light}
1380   \bitbox{11}{} 
1381 \end{bytefield}} \\
1382 \hline
1383 \color{black}
1384 \\
1385 Set Flags &
1386 {\tt\begin{bytefield}{36}
1387   \bitheader[b]{0,11,12,21-30,35}\\
1388 \common 
1389 \color{light}
1390   \bitbox{3}{} 
1391   \bitbox{1}{} 
1392   \bitbox{1}{} 
1393   \bitbox{1}{} 
1394   \bitbox{1}{} 
1395   \bitbox{1}{} 
1396 \color{black}
1397   \bitbox{1}{1} 
1398 \color{light}
1399   \bitbox{9}{} 
1400 \color{black}
1401   \bitbox{6}{FlagB}
1402   \bitbox{6}{FlagA}
1403 \end{bytefield}} \\\hline
1404 \\
1405 Decrement OLC &
1406 {\tt\begin{bytefield}{36}
1407   \bitheader[b]{0,20-30,35}\\
1408 \common
1409 \color{light}
1410   \bitbox{3}{} 
1411   \bitbox{1}{} 
1412   \bitbox{1}{} 
1413   \bitbox{1}{} 
1414 \color{black}
1415   \bitbox{1}{1} 
1416 \color{light}
1417   \bitbox{1}{} 
1418   \bitbox{1}{} 
1419 \color{black}
1420   \bitbox{1}{1}
1421 \color{light}
1422   \bitbox{20}{} 
1423 \color{black}
1424 \end{bytefield}} \\
1425 Data Latch\to OLC &
1426 {\tt\begin{bytefield}{36}
1427   \bitheader[b]{0,19-30,35}\\
1428 \common
1429 \color{light}
1430   \bitbox{3}{} 
1431   \bitbox{1}{} 
1432   \bitbox{1}{} 
1433   \bitbox{1}{} 
1434   \bitbox{1}{} 
1435 \color{black}
1436   \bitbox{1}{1} 
1437 \color{light}
1438   \bitbox{1}{} 
1439 \color{black}
1440   \bitbox{1}{1}
1441 \color{light}
1442 \color{black}
1443   \bitbox{1}{1} 
1444 \color{light}
1445   \bitbox{19}{} 
1446 \color{black}
1447 \end{bytefield}} \\
1448 Immediate\to OLC &
1449 {\tt\begin{bytefield}{36}
1450   \bitheader[b]{0,5,19-30,35}\\
1451 \common
1452 \color{light}
1453   \bitbox{3}{} 
1454   \bitbox{1}{} 
1455   \bitbox{1}{} 
1456   \bitbox{1}{} 
1457   \bitbox{1}{} 
1458 \color{black}
1459   \bitbox{1}{1} 
1460 \color{light}
1461   \bitbox{1}{} 
1462 \color{black}
1463   \bitbox{1}{1}
1464 \color{light}
1465 \color{black}
1466   \bitbox{1}{{0}} 
1467 \color{light}
1468   \bitbox{13}{} 
1469 \color{black}
1470   \bitbox{6}{Immediate} 
1471 \end{bytefield}} \\\hline
1472 \\
1473 Data Latch\to ILC &
1474 {\tt\begin{bytefield}{36}
1475   \bitheader[b]{0,19,21-30,35}\\
1476 \common
1477 \color{light}
1478   \bitbox{3}{} 
1479   \bitbox{1}{} 
1480   \bitbox{1}{} 
1481   \bitbox{1}{} 
1482   \bitbox{1}{} 
1483 \color{black}
1484   \bitbox{1}{1} 
1485 \color{light}
1486   \bitbox{1}{} 
1487 \color{black}
1488   \bitbox{1}{0} 
1489   \bitbox{1}{1} 
1490 \color{light}
1491   \bitbox{19}{} 
1492 \color{black}
1493 \end{bytefield}} \\
1494 Immediate\to ILC &
1495 {\tt\begin{bytefield}{36}
1496   \bitheader[b]{0,5,7,19,21-30,35}\\
1497 \common
1498 \color{light}
1499   \bitbox{3}{} 
1500   \bitbox{1}{} 
1501   \bitbox{1}{} 
1502   \bitbox{1}{} 
1503   \bitbox{1}{} 
1504 \color{black}
1505   \bitbox{1}{1} 
1506 \color{light}
1507   \bitbox{1}{} 
1508 \color{black}
1509   \bitbox{1}{0} 
1510   \bitbox{1}{0} 
1511 \color{light}
1512   \bitbox{10}{} 
1513 \color{light}
1514   \bitbox{1}{} 
1515 \color{black}
1516   \bitbox{1}{0${}^\star$} 
1517 \color{light}
1518   \bitbox{1}{} 
1519 \color{black}
1520   \bitbox{6}{Immediate} 
1521 \end{bytefield}} \\
1522 $\infty$\to ILC &
1523 {\tt\begin{bytefield}{36}
1524   \bitheader[b]{0,7,21-30,35}\\
1525 \common
1526 \color{light}
1527   \bitbox{3}{} 
1528   \bitbox{1}{} 
1529   \bitbox{1}{} 
1530   \bitbox{1}{} 
1531   \bitbox{1}{} 
1532 \color{black}
1533   \bitbox{1}{1} 
1534 \color{light}
1535   \bitbox{1}{} 
1536 \color{black}
1537   \bitbox{1}{0} 
1538 \color{light}
1539   \bitbox{11}{} 
1540 \color{light}
1541   \bitbox{1}{} 
1542 \color{black}
1543   \bitbox{1}{1${}^\star$} 
1544 \color{light}
1545   \bitbox{1}{} 
1546 \color{light}
1547   \bitbox{6}{} 
1548 \end{bytefield}} \\\hline
1549 \\
1550 {\tt head} &
1551 {\tt\begin{bytefield}{36}
1552   \bitheader[b]{29}\\
1553 \color{light}
1554   \bitbox{6}{} 
1555 \color{black}
1556   \bitbox{1}{1} 
1557 \color{light}
1558   \bitbox{2}{} 
1559 \color{light}
1560   \bitbox{27}{} 
1561 \end{bytefield}} \\
1562 {\tt abort${}^1$} &
1563 {\tt\begin{bytefield}{36}
1564   \bitheader[b]{28}\\
1565 \color{black}
1566   \bitbox{6}{Predicate}
1567 \color{light}
1568   \bitbox{1}{} 
1569 \color{black}
1570   \bitbox{1}{1} 
1571 \color{light}
1572   \bitbox{6}{} 
1573 \color{black}
1574   \bitbox{1}{1} 
1575 \color{light}
1576   \bitbox{9}{} 
1577 \color{black}
1578   \bitbox{1}{0} 
1579   \bitbox{1}{0} 
1580   \bitbox{1}{0} 
1581   \bitbox{1}{1} 
1582   \bitbox{1}{0} 
1583   \bitbox{1}{0} 
1584   \bitbox{1}{0} 
1585   \bitbox{1}{0} 
1586   \bitbox{1}{0} 
1587   \bitbox{1}{0} 
1588   \bitbox{1}{0} 
1589   \bitbox{1}{1}
1590 \end{bytefield}} \\
1591 {\tt tail} &
1592 {\tt\begin{bytefield}{36}
1593   \bitheader[b]{27}\\
1594 \color{light}
1595   \bitbox{6}{} 
1596 \color{light}
1597   \bitbox{2}{} 
1598 \color{black}
1599   \bitbox{1}{1} 
1600 \color{light}
1601   \bitbox{27}{} 
1602 \end{bytefield}} \\
1603 \\
1604 \end{tabular}
1605 $\star$ -- Bit 8 is the ``infinity'' bit \\
1606 $\dagger$ -- When a ``Move, Path unchanged'' is performed, bit 12 is copied to the ``flushing latch''.  \\
1607 .\hspace{0.5cm} When a ship fires, it examines the ``flushing latches'' of all of its inboxes as part of its decision about what to do. \\
1608 $1$ -- The encoding of the {\tt abort} instruction was chosen in order to make it look like a {\tt set flags} instruction which does not change the flags. \\
1609 Tp\ \ = Torpedoable (1=Torpedoable, 0=Not-Torpedoable) \\
1610 rD\ \ = recompute D-flag (1=recompute, 0=leave unchanged)
1611 %\end{landscape}
1612 \end{sidewaysfigure} 
1613
1614 \pagebreak
1615 \section*{Marina Dock Block Diagram}
1616 This diagram was produced by Ivan Sutherland.
1617 \\
1618 \epsfig{file=blockDiagram,width=8in,angle=90}
1619
1620 \end{document}