update architecture manual: include Ig bit
[fleet.git] / doc / archman.tex
1 \documentclass[10pt,oneside]{book}
2 \reversemarginpar 
3 \usepackage{palatino}
4 \usepackage{parskip}
5 \usepackage{register}
6 \usepackage{bytefield}
7 \renewcommand{\ttdefault}{cmtt}
8 \title{The FleetTwo Architecture Manual}
9 \begin{document}
10 \maketitle
11 \pagebreak
12 \section*{Glossary}
13
14 Port\\
15 Inlet\\
16 Outlet\\
17 Pump\\
18 Packet\\
19 Data Item\\
20 Opcode Port\\
21 Bypass\\
22
23
24 \pagebreak
25 \section*{Data Formats}
26
27 \subsection*{Packet Destination Address (12 bits)}
28
29 These bits appear physically within the switch fabric, and have
30 ``address bit timing.''  The {\tt T} bit is the ``tokenhood'' bit; if
31 set, this packet represents a token and it does not cause the switch
32 fabric data latches to fire.
33
34 {\tt\footnotesize
35 \begin{bytefield}{49}
36   \bitheader[b]{37,47,48}\\
37   \bitbox{1}{T} 
38   \bitbox{11}{Destination Address} 
39   \bitbox[l]{37}{} 
40 \end{bytefield}
41 }
42
43 \subsection*{Data Word In Memory (37 bits)}
44
45 A word of memory is 37 bits wide.  For convenience, we assume that the
46 memory word width is also the width of a pointer as well as the width
47 of all on-chip data item registers.
48
49 {\tt\footnotesize
50 \begin{bytefield}{49}
51   \bitheader[b]{0,36}\\
52   \bitbox[r]{12}{}
53   \bitbox{37}{Data Word} 
54 \end{bytefield}
55 }
56
57 \subsection*{Data Packet In Flight (49 bits)}
58
59 A {\it data packet} is a data item in the switch fabric, on its way to
60 some destination.
61
62 {\tt\footnotesize
63 \begin{bytefield}{49}
64   \bitheader[b]{0,36,37,47,48}\\
65   \bitbox{1}{T} 
66   \bitbox{11}{Destination Address} 
67   \bitbox{37}{Data Word} 
68 \end{bytefield}
69 }
70
71 \subsection*{Instruction In Memory (37 bits)}
72
73 An instruction must be no wider than a memory word.  The next section
74 explains the bits in greater detail.
75
76 {\tt\tiny
77 \begin{bytefield}{49}
78   \bitheader[b]{0,10,11,17,18-26,36}\\
79   \bitbox[r]{12}{}
80   \bitbox{11}{Instruction Register Address} 
81   \bitbox{1}{K} 
82   \bitbox{1}{L} 
83   \bitbox{1}{Ti} 
84   \bitbox{1}{Di} 
85   \bitbox{1}{Dc} 
86   \bitbox{1}{Do} 
87   \bitbox{1}{To} 
88   \bitbox{1}{Rq} 
89   \bitbox{7}{Count} 
90   \bitbox{11}{Data/Token Destination} 
91 \end{bytefield}
92 }
93
94 \subsection*{Instruction Packet In Flight (49 bits)}
95
96 A {\it instruction packet} is an instruction in the instruction horn
97 (which may or may not be the same thing as the data horn), on its way
98 to some instruction register (Valve).
99
100 {\tt\tiny
101 \begin{bytefield}{49}
102   \bitheader[b]{0,10,11,17,18-25,37,47,48}\\
103   \bitbox[r]{1}{0} 
104   \bitbox{11}{Instruction Register Address} 
105   \bitbox[lr]{11}{}
106   \bitbox{1}{K} 
107   \bitbox{1}{L} 
108   \bitbox{1}{Ti} 
109   \bitbox{1}{Di} 
110   \bitbox{1}{Dc} 
111   \bitbox{1}{Do} 
112   \bitbox{1}{To} 
113   \bitbox{1}{Rq} 
114   \bitbox{7}{Count} 
115   \bitbox{11}{Data/Token Destination} 
116 \end{bytefield}
117 }
118
119
120 \pagebreak
121
122 \section*{Instruction Formats}
123
124 Instructions can be grouped into two categories: {\it killing}
125 instructions, which are acted upon as soon as they leave the
126 instruction horn, and {\it executing} instructions, which pass through
127 the instruction queue before being acted upon.
128
129 Blank fields below are reserved for future use and must be set to
130 zero.
131
132 Note that the arbiter is requested whenever {\it any of the first
133   three bits is {\tt 1}}.  If the arbiter is not requested, 
134
135
136
137 \setlength{\bitwidth}{5mm}
138
139 \subsection*{Killing Instructions}
140
141 Kill (kill anything other than a Clog)
142
143 {\tt
144 \begin{bytefield}{26}
145   \bitheader[b]{0,6,7,20-25}\\
146   \bitbox{1}{0} 
147   \bitbox{1}{0} 
148   \bitbox{1}{1} 
149   \bitbox{1}{0} 
150   \bitbox{1}{1} 
151   \bitbox{14}{}
152   \bitbox{7}{Count} 
153 \end{bytefield}}
154
155 UnClog (kill a Clog)
156
157 {\tt
158 \begin{bytefield}{26}
159   \bitheader[b]{0,20-25}\\
160   \bitbox{1}{0} 
161   \bitbox{1}{0} 
162   \bitbox{1}{0} 
163   \bitbox{1}{1} 
164   \bitbox{1}{0} 
165   \bitbox{21}{}
166 \end{bytefield}}
167
168 \subsection*{Executing Instructions}
169 Clog
170
171 {\tt
172 \begin{bytefield}{26}
173   \bitheader[b]{0,20-25}\\
174   \bitbox{1}{0} 
175   \bitbox{1}{0} 
176   \bitbox{1}{1} 
177   \bitbox{1}{0} 
178   \bitbox{1}{0} 
179   \bitbox{21}{}
180 \end{bytefield}}
181
182 Literal (sign extended, implicit {\tt Rq=1})
183
184 {\tt
185 \begin{bytefield}{26}
186   \bitheader[b]{0,6,7,23-25}\\
187   \bitbox{1}{0} 
188   \bitbox{1}{1} 
189   \bitbox{17}{Literal}
190   \bitbox{7}{Count} 
191 \end{bytefield}}
192
193
194 Normal
195
196 {\tt
197 \begin{bytefield}{26}
198   \bitheader[b]{0,6,7,17-25}\\
199   \bitbox{1}{1} 
200   \bitbox{1}{Ti} 
201   \bitbox{1}{Di} 
202   \bitbox{1}{Dc} 
203   \bitbox{1}{Do} 
204   \bitbox{1}{To} 
205   \bitbox{1}{Ig} 
206   \bitbox{1}{Rq} 
207   \bitbox{11}{Dest} 
208   \bitbox{7}{Count} 
209 \end{bytefield}}
210
211
212
213
214 \pagebreak
215 \subsection*{Field Descriptions}
216 {\tt
217 \begin{bytefield}{26}
218   \bitheader[b]{0,6,7,16-25}\\
219   \bitbox{1}{0} 
220   \bitbox{1}{Ti} 
221   \bitbox{1}{Di} 
222   \bitbox{1}{Dc} 
223   \bitbox{1}{Do} 
224   \bitbox{1}{To} 
225   \bitbox{1}{Ig} 
226   \bitbox{1}{Rq} 
227   \bitbox{11}{Dest} 
228   \bitbox{7}{Count} 
229 \end{bytefield}
230 }
231
232 \begin{itemize}
233
234   \item [\tt Ti] ({\bf Token Input}) wait for a token and accept
235                  it\footnote{{\tt Ti}=1,{\tt Di}=1 is invalid on inbox.}
236
237   \item [\tt Di] ({\bf Data Input}) wait for a datum and accept it.
238
239   \item [\tt Dc] ({\bf Data Capture}) capture (latch) the accepted
240                  datum.  This bit is ignored if the incoming packet is
241                  a token. \footnote{ Note that {\tt Di}=0,{\tt Dc}=1
242                  is meaningless and therefore reserved for other
243                  uses.}
244
245   \item [\tt Do] ({\bf Data Output}) emit a datum.
246
247   \item [\tt To] ({\bf Token Output}) emit a token.\footnote{ {\tt To}=1,{\tt
248                  Do}=1 is invalid on outbox.}
249
250   \item [\tt Ig] ({\bf Ignore {\tt To} Until Last Iteration}) ignore
251                  the {\tt To} bit unless {\tt Count=0} \footnote{{\tt
252                  To}=0,{\tt Ig}=1 is invalid, {\tt Rq}=0,{\tt Ig}=1 is invalid}
253
254   \item [\tt Rq] ({\bf ReQueue}) if set, instructions having nonzero
255                  count are ``Re-Queued'' rather than RePeated.  See
256                  {\tt Count} for more detail. \footnote{ An
257                  instruction {\it in memory} may not have {\tt
258                  Rq=1,Count=0} (use {\tt Rq=0,Count=0})}
259
260   \item  [\tt Count] ({\bf Count}) {\it After} executing:
261 \begin{verbatim}
262 if (Count==0) {
263     discard this instruction
264 } else {
265     if Count<1111111 {
266       decrement count
267     }
268     if Rq=1 or Literal {
269        put this instruction back into the instruction fifo
270     } else {
271        execute this instruction again
272     }
273 }
274 \end{verbatim}
275 Note how a ``standing'' instruction is encoded as {\tt Count=1111111}       
276
277 \item [\tt Dest] ({\bf Data/Token Destination})
278    This field is copied into the address portion of any outgoing
279    packet ({\tt Do} on an outbox or {\tt To}).
280
281 \end{itemize}
282