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