updates to ship documentation
authoradam <adam@megacz.com>
Tue, 3 Jul 2007 07:01:41 +0000 (08:01 +0100)
committeradam <adam@megacz.com>
Tue, 3 Jul 2007 07:01:41 +0000 (08:01 +0100)
ships/Alu2.ship
ships/BitFifo.ship
ships/Choice.ship
ships/Shift.ship [deleted file]

index ae0a019..622be27 100644 (file)
@@ -24,10 +24,12 @@ Use carry-in bit to create a selector?  Perhaps a waste of an ALU.
 
 Flags: zero, negative, overflow, ?
 
+\begin{verbatim}
 move elsewhere:
 //MUL:
 //DIV:
 //MOD:
+\end{verbatim}
 
 == Fleeterpreter ====================================================
 public long resolveLiteral(String literal) {
index 0012316..60de543 100644 (file)
@@ -18,63 +18,76 @@ data  out:  out
 
 == TeX ==============================================================
 
-+------+   +--------------+   +-------+
-|inData|---|              |---|outData|
-+------+   |              |   +-------+
-           |              |
-+------+   |              |   +-------+
-| inOp |---|              |---| outOp |
-+------+   +--------------+   +-------+
+\begin{verbatim}
++-------------+   +---------------+   +------------+
+| inEnqueue   |-->|               |-->| outDequeue |
++-------------+   |               |   +------------+
+                  |    BitFifo    |
++-------------+   |               |   +-------------+
+| inEnqueueOp |-->|               |<--| inDequeueOp |
++-------------+   +---------------+   +-------------+
+\end{verbatim}
 
-inOp
-+---+
-|   |  -- reverse before enqueue
-+---+
-|   |  -- count := (37-offset-count)
-+---+
-|   |  -- count (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
-|   |  -- offset (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
+\section*{inEnqueueOp}
+\setlength{\bitwidth}{6mm}
+{\tt\footnotesize
+\begin{bytefield}{14}
+  \bitheader[b]{0,5,6,11,12,13}\\
+  \bitbox{1}{Rev} 
+  \bitbox{1}{Inv} 
+  \bitbox{6}{Count} 
+  \bitbox{6}{Offset} 
+\end{bytefield}
+}
+
+\begin{itemize}
+   \item [\tt Rev]    ({\bf Reverse Before Enqueue})
+   \item [\tt Inv]    ({\bf Invert Count}) -- treat {\tt Count} as {\tt 37-Offset-Count}
+   \item [\tt Count]  ({\bf Count of Bits To Enqueue})
+   \item [\tt Offset] ({\bf Offset of Bits To Enqueue})
+\end{itemize}
+
+By default, bits are enqueued {\it most significant bit first} (bits
+in Sun byte order).  If {\tt Rev=1}, the bits are reversed before
+performing the directions below.
+
+If {\tt Inv=1}, then the {\tt Count} field is treated as if its value
+was actually {\tt 37-Offset-Count} for all directions below.
+
+
+
+\pagebreak
+
+\section*{inDequeueOp}
+\setlength{\bitwidth}{6mm}
+{\tt\scriptsize
+\begin{bytefield}{23}
+  \bitheader[b]{0,5,6,11-21,22}\\
+  \bitbox{2}{Until} 
+  \bitbox{1}{Sort} 
+  \bitbox{1}{Get} 
+  \bitbox{1}{Rev} 
+  \bitbox{1}{Inv} 
+  \bitbox{1}{Rst} 
+  \bitbox{2}{Left\\ Fill} 
+  \bitbox{2}{Right\\ Fill} 
+  \bitbox{6}{Count} 
+  \bitbox{6}{Offset} 
+\end{bytefield}
+}
 
-outOp
-+---+
-|   |  -- shift until you see a "Z" (2 bits)
-+---+
-|   |  -- sort the digits
-+---+
-|   |  -- give me the count
-+---+
-|   |  -- reverse after dequeue
-+---+
-|   |  -- count := 37-off-count
-+---+
-|   |  -- reset the counter before operation
-+---+
-|   |  -- fill left with (1,0,sign)  (2 bits)
-+---+
-|   |  -- fill right with (1,0,sign)  (2 bits)
-+---+
-|   |  -- count (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
-|   |  -- offset (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
+\begin{itemize}
+   \item [\tt Until]  ({\bf Shift until you see a (0, 1)})
+   \item [\tt Sort]   ({\bf Sort the Bits})
+   \item [\tt Get]    ({\bf Get the value of the counter})
+   \item [\tt Rev]    ({\bf Reverse Before Enqueue})
+   \item [\tt Inv]    ({\bf Invert Count}) -- treat {\tt Count} as {\tt 37-Offset-Count}
+   \item [\tt Rst]    ({\bf Reset Counter Before Operation})
+   \item [\tt Left Fill]  ({\bf Left Fill (0, 1, sign)})
+   \item [\tt Right Fill]  ({\bf Right Fill (0, 1, sign)})
+   \item [\tt Count]  ({\bf Count of Bits To Enqueue})
+   \item [\tt Offset] ({\bf Offset of Bits To Enqueue})
+\end{itemize}
 
 
 == Fleeterpreter ====================================================
index 0b084f3..ab5a205 100644 (file)
@@ -45,6 +45,7 @@ If(Non)Positive, If(Non)Negative) determines the condition which the
 datum on the in port is tested for.  The former portion (mux, demux,
 swap) determines the *action* to be taken if the condition tests true.
 
+\begin{verbatim}
   action   condition    effect
   ------   ---------    -------------------------------
   swap     false        in1->out1   in2->out2
@@ -53,6 +54,7 @@ swap) determines the *action* to be taken if the condition tests true.
   mux      true         in2->out1
   demux    false        in1->out1
   demux    true         in1->out2
+\end{verbatim}
 
 In each case, the ship will wait for a datum to be available on all
 input ports (and only those ports) mentioned in the appropriate row of
diff --git a/ships/Shift.ship b/ships/Shift.ship
deleted file mode 100644 (file)
index 18ef138..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-ship: Shift
-
-== Ports ===========================================================
-data in:  in
-data in:  inShift
-data out: out
-
-== Constants ========================================================
-
-== TeX ==============================================================
-To Do:
-- deal with sign-extension
-- rotate (in addition to shift)?
-- rotate, shift, and sign-extend subfields of a word?
-- scan for lowest/highest bit which is set/clear?
-- bitfields crossing two words
-
-== Fleeterpreter ====================================================
-    public void service() {
-        if (box_in.dataReadyForShip() && box_inShift.dataReadyForShip()) {
-            long val = box_in.removeDataForShip();
-            long inShift = box_inShift.removeDataForShip();
-            if (inShift < 0) val = val >> (-1 * inShift);
-            else           val = val << inShift;
-            box_out.addDataFromShip(val);
-        }
-    }
-
-== FleetSim ==============================================================
-== FPGA ==============================================================
-// not implemented FIXME!
-
-== Contributors =========================================================
-Adam Megacz <megacz@cs.berkeley.edu>