tentative Fi bit in archman.tex
[fleet.git] / doc / archman.tex
1 \documentclass[10pt]{book}
2 \usepackage{amsmath}
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
12 \pagebreak
13 \section*{Data Formats}
14
15 \subsection*{Packet Destination Address (12 bits)}
16
17 These bits appear physically within the switch fabric, and have
18 ``address bit timing.''  The {\tt T} bit is the ``tokenhood'' bit; if
19 set, this packet represents a token and it does not cause the switch
20 fabric data latches to fire.
21
22 {\tt\footnotesize
23 \begin{bytefield}{49}
24   \bitheader[b]{37,47,48}\\
25   \bitbox{1}{T} 
26   \bitbox{11}{Destination Address} 
27   \bitbox[l]{37}{} 
28 \end{bytefield}
29 }
30
31 \subsection*{Data Word In Memory (37 bits)}
32
33 A word of memory is 37 bits wide.  For convenience, we assume that the
34 memory word width is also the width of a pointer as well as the width
35 of all on-chip data item registers.
36
37 {\tt\footnotesize
38 \begin{bytefield}{49}
39   \bitheader[b]{0,36}\\
40   \bitbox[r]{12}{}
41   \bitbox{37}{Data Word} 
42 \end{bytefield}
43 }
44
45 \subsection*{Data Packet In Flight (49 bits)}
46
47 A {\it data packet} is a data item in the switch fabric, on its way to
48 some destination.
49
50 {\tt\footnotesize
51 \begin{bytefield}{49}
52   \bitheader[b]{0,36,37,47,48}\\
53   \bitbox{1}{T} 
54   \bitbox{11}{Destination Address} 
55   \bitbox{37}{Data Word} 
56 \end{bytefield}
57 }
58
59 \subsection*{Instruction In Memory (37 bits)}
60
61 An instruction must be no wider than a memory word.  The next section
62 explains the bits in greater detail.
63
64 {\tt\tiny
65 \begin{bytefield}{49}
66   \bitheader[b]{0,10,11,17,18-26,36}\\
67   \bitbox[r]{12}{}
68   \bitbox{11}{Instruction Register Address} 
69   \bitbox{1}{K} 
70   \bitbox{1}{L} 
71   \bitbox{1}{Ti} 
72   \bitbox{1}{Di} 
73   \bitbox{1}{Ld} 
74   \bitbox{1}{Do} 
75   \bitbox{1}{To} 
76   \bitbox{1}{Rq} 
77   \bitbox{7}{Count} 
78   \bitbox{11}{Data/Token Destination} 
79 \end{bytefield}
80 }
81
82 \subsection*{Instruction Packet In Flight (49 bits)}
83
84 A {\it instruction packet} is an instruction in the instruction horn
85 (which may or may not be the same thing as the data horn), on its way
86 to some instruction register (BenkoBox).
87
88 {\tt\tiny
89 \begin{bytefield}{49}
90   \bitheader[b]{0,10,11,17,18-25,37,47,48}\\
91   \bitbox[r]{1}{0} 
92   \bitbox{11}{Instruction Register Address} 
93   \bitbox[lr]{11}{}
94   \bitbox{1}{K} 
95   \bitbox{1}{L} 
96   \bitbox{1}{Ti} 
97   \bitbox{1}{Di} 
98   \bitbox{1}{Ld} 
99   \bitbox{1}{Do} 
100   \bitbox{1}{To} 
101   \bitbox{1}{Rq} 
102   \bitbox{7}{Count} 
103   \bitbox{11}{Data/Token Destination} 
104 \end{bytefield}
105 }
106
107
108 \pagebreak
109
110 \section*{Instruction Format Detail}
111
112 \setlength{\bitwidth}{5mm}
113 {\tt
114 \begin{bytefield}{26}
115   \bitheader[b]{0,10,11,17,18-25}\\
116   \bitbox{1}{K} 
117   \bitbox{1}{L} 
118   \bitbox{1}{Ti} 
119   \bitbox{1}{Di} 
120   \bitbox{1}{Ld} 
121   \bitbox{1}{Do} 
122   \bitbox{1}{To} 
123   \bitbox{1}{Rq} 
124   \bitbox{7}{C} 
125   \bitbox{11}{Dest} 
126 \end{bytefield}
127 }
128
129 \begin{itemize}
130
131    \item [\tt K] ({\bf Kill}) if set, this instruction is a kill;
132                  ignore all further directions below.
133
134    \item [\tt L] ({\bf Literal}) if set, use all bits below except
135                  {\tt Count} (17 bits) as a literal, sign extend them,
136                  and load into the data register; ignore all further
137                  directions below except {\tt Count}.
138
139   \item [\tt Ti] ({\bf Token Input}) wait for a token and acknowledge
140                  it; {\tt Ti}=1,{\tt Di}=1 is invalid on inbox
141
142   \item [\tt Di] ({\bf Data Input}) wait for a datum and acknowledge
143                  it
144
145   \item [\tt Dc] ({\bf Data Capture}) capture (latch) a datum; {\tt
146                  Di}=0,{\tt Dc}=1 is invalid.  This bit is ignored if
147                  the {\tt T} (token) bit is set on the incoming
148                  packet.
149
150   \item [\tt Do] ({\bf Data Output}) emit a datum
151
152   \item [\tt To] ({\bf Token Output}) emit a token; {\tt To}=1,{\tt
153                  Do}=1 is invalid on outbox
154
155 %  \item [\tt Fi] ({\bf Final Iteration}) emit a token when {\tt
156 %                 Count=0} (ie the last iteration of a requeueing
157 %                 loop); {\tt Tl}=1,{\tt To}=1 is invalid.
158
159   \item [\tt Rq] ({\bf ReQueue}) if set, instructions having nonzero
160                  count are ``Re-Queued'' in the instruction queue
161                  after execution (see below); otherwise instructions
162                  with nonzero count are executed again immediately.
163
164   \item  [\tt C] ({\bf Count}) {\it After} executing:
165 \begin{verbatim}
166 if Count==0 { discard this instruction }
167 else {
168     if Count<1111111 { decrement count }
169     if Rq=1 and L=0 {
170        put this instruction back into the instruction fifo
171     } else {
172        execute this instruction again
173     }
174 }
175 \end{verbatim}               
176
177 \item [\tt Dest] ({\bf Data/Token Destination})
178    Any packets (token or datum) emitted {\it to the switch fabric}
179    will be emitted with this address in the packet's destination
180    field.
181 \end{itemize}
182
183 \subsection*{Notes}
184 \begin{itemize}
185 \item A "standing" instruction is encoded as {\tt Count}=$\text{\tt 1111111}_\text{two}$
186
187 \item A {\tt clog} is encoded as a "standing" {\tt nop} ({\tt Ti},
188       {\tt Di}, {\tt Dc}, {\tt Do}, {\tt To} all cleared)
189
190 \item An {\tt unclog} is encoded as {\tt K=1},{\tt Ti=1}
191
192 \end{itemize}