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(); public void service() { if (box_in.dataReadyForShip()) { fifo.add(box_in.removeDataForShip()); } if (box_out.readyForDataFromShip() && fifo.size() > 0) { box_out.addDataFromShip(fifo.remove()); } } == FleetSim ============================================================== == FPGA ============================================================== wire in0_a; wire out0_r; wire [(`DATAWIDTH-1):0] out0_d; fifo8 fifo8(clk, rst, in_r, in0_a, in_d, out0_r, out_a, out0_d); always @(posedge clk) begin if (!rst) begin `reset end else begin in_a <= in0_a; out_r <= out0_r; out_d <= out0_d; end end == Test ================================================================= // expected output #expect 9 // ships required in order to run this code #ship debug : Debug #ship fifo : Fifo debug.in: [*] take, deliver; fifo.in: literal 9; deliver; load repeat counter with 63; take, deliver; load repeat counter with 37; take, deliver; fifo.out: load repeat counter with 63; take, sendto fifo.in; load repeat counter with 36; take, sendto fifo.in; take, sendto debug.in; == Contributors ========================================================= Adam Megacz