add more ship files
[fleet.git] / ships / Fifo.ship
diff --git a/ships/Fifo.ship b/ships/Fifo.ship
new file mode 100644 (file)
index 0000000..8c96494
--- /dev/null
@@ -0,0 +1,24 @@
+ship: Fifo
+
+== Ports ===========================================================
+data  in:   in
+data  out:  out
+
+== Constants ========================================================
+== TeX ==============================================================
+== Fleeterpreter ====================================================
+    private Queue<Integer> fifo = new LinkedList<Integer>();
+    public void service() {
+        if (box_in.dataReadyForShip()) {
+            fifo.add(box_in.removeDataForShip());
+        }
+        if (box_out.readyForDataFromShip() && fifo.size() > 0) {
+            box_out.addDataFromShip(fifo.remove());
+        }
+    }
+
+== ArchSim ==============================================================
+== FPGA ==============================================================
+
+== Contributors =========================================================
+Adam Megacz <megacz@cs.berkeley.edu>