alter Alu1 test to work around fpga anomoly
[fleet.git] / ships / BitFifo.ship
index 0349b0c..e315122 100644 (file)
@@ -28,9 +28,9 @@ more.
 
 Bits are enqueued by providing a word at the {\tt in} port and a code
 word at the {\tt inOp} port (ports are named this way to take
-advantage of the switch fabric opcode mechanism).  As shown in the
-constant diagram, this code word has fields {\tt lsbFirst}, {\tt
-msbFirst}, {\tt drop}, and {\tt take}.
+advantage of the switch fabric opcode mechanism \cite{am25}).  As
+shown in the constant diagram, this code word has fields {\tt
+lsbFirst}, {\tt msbFirst}, {\tt drop}, and {\tt take}.
 
 When a word is consumed from {\tt in}, it is ``oriented'' in either
 Most Significant Bit First ({\tt msbFirst}) or Least Significant Bit
@@ -378,6 +378,12 @@ public void service() {
   initial bitstorage_count = 0;
 
   always @(posedge clk) begin
+    if (!rst) begin
+      bitstorage_count <= 0;
+      enqueue_remaining <= 0;
+      dequeue_remaining <= 0; 
+      `reset
+    end else begin
     if (!in_r    && in_a)     in_a    <= 0;
     if (!inOp_r  && inOp_a)   inOp_a  <= 0;
     if (!outOp_r && outOp_a)  outOp_a <= 0;
@@ -422,6 +428,7 @@ public void service() {
       out_d <= (outOp_d[`OP_SIGNEXT] && bitstorage[outOp_d[`OP_DROP]]) ? 37'b1111111111111111111111111111111111111 : 0;
 
     end
+    end
   end
 
 
@@ -442,7 +449,7 @@ public void service() {
 bitfifo.outOp:      literal BitFifo.outOp[take=37]; [*] deliver;
 bitfifo.out:        [*] take, sendto debug.in;
 debug.in:           [*] take, deliver;
-bitfifo.in:         literal 1; [2] deliver;
+bitfifo.in:         literal 1; load repeat counter with 2; deliver;
 
 bitfifo.inOp:
   literal BitFifo.inOp[take=37];