3 == Ports ===========================================================
7 == Constants ========================================================
9 == TeX ==============================================================
10 A stack ship with capacity for at least 32 elements.
12 Push operations are executed as soon as an inbound datum is {\tt
13 deliver}ed on the {\tt push} port. Completion of a push can be
14 confirmed by sending a {\tt notify} token from the {\tt push} port.
16 Pop operations are executed no earlier than the time at which the {\tt
17 pop} port attempts to {\tt take} data from the ship.
19 When the stack becomes full, it will simply not process any new {\tt
20 push} operations. When the stack becomes empty, it will simply not
21 process any new {\tt pop} operations.
23 == Fleeterpreter ====================================================
24 private ArrayList<Long> stack = new ArrayList<Long>();
25 public void service() {
26 if (box_push.dataReadyForShip() && stack.size()<32) {
27 stack.add(box_push.removeDataForShip());
29 if (box_pop.readyForDataFromShip() && stack.size() > 0) {
30 box_pop.addDataFromShip(stack.get(stack.size()-1));
31 stack.remove(stack.size()-1);
35 == FleetSim ==============================================================
36 == FPGA ==============================================================
37 /* FIXME: inefficient */
38 reg [(`DATAWIDTH-1):0] mem [4:0];
43 always @(posedge clk) begin
46 `onwrite(pop_r, pop_a)
48 pop_d <= mem[depth-2];
54 if (!skip && depth < 32) begin
55 `onread(push_r, push_a)
64 == Test ====================================================
74 debug.in: [*] take, deliver;
75 stack.push: [5] take, deliver; notify stack.pop;
77 stack.pop: wait; [*] take, sendto debug.in;
88 == Contributors =========================================================
89 Adam Megacz <megacz@cs.berkeley.edu>