X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ships%2FFifo.ship;h=616c97b7c4dd07c88f937252dc7fc17c526ddc8c;hb=cbafca81451a452015ea365b3546c3bc0ac7bdbd;hp=8c96494d230edbc02a01d0b066ad76bc742f695d;hpb=eac37cd0d8008155d6333f6904b6597a8d2b26f7;p=fleet.git diff --git a/ships/Fifo.ship b/ships/Fifo.ship index 8c96494..616c97b 100644 --- a/ships/Fifo.ship +++ b/ships/Fifo.ship @@ -2,12 +2,22 @@ ship: Fifo == Ports =========================================================== data in: in + data out: out == Constants ======================================================== + == TeX ============================================================== + +The {\tt Fifo} ship is a simple fifo. Word-sized delivered to the {\tt +in} port are enqueued into the fifo, and values which arrive at the +end of the fifo are provided to the {\tt out} port. + +The internal capacity of the fifo is unspecified, but guaranteed to be +at least 16 words. + == Fleeterpreter ==================================================== - private Queue fifo = new LinkedList(); + private Queue fifo = new LinkedList(); public void service() { if (box_in.dataReadyForShip()) { fifo.add(box_in.removeDataForShip()); @@ -17,8 +27,37 @@ data out: out } } -== ArchSim ============================================================== +== FleetSim ============================================================== + == FPGA ============================================================== +// not used + +== Test ================================================================= +// expected output +#expect 9 + +// ships required in order to run this code +#ship debug : Debug +#ship fifo : Fifo + +debug.in: set ilc=*; recv, deliver; +fifo.in: + set word= 9; + deliver; + set ilc=63; + recv, deliver; + set ilc=37; + recv, deliver; + +fifo.out: + set ilc=63; + collect, send to fifo.in; + set ilc=36; + collect, send to fifo.in; + collect, send to debug.in; + + + == Contributors ========================================================= Adam Megacz