move the packet queue out of InterpreterDestination and into InterpreterDock
[fleet.git] / src / edu / berkeley / fleet / interpreter / DebugDock.java
1 package edu.berkeley.fleet.interpreter;
2 import java.util.*;
3 import edu.berkeley.fleet.two.*;
4 import edu.berkeley.fleet.api.*;
5 import edu.berkeley.fleet.api.Instruction;
6 import static edu.berkeley.fleet.api.Predicate.*;
7
8 /** EXPERIMENTAL -- DO NOT RELY ON THIS INTERFACE */
9 public class DebugDock {
10     final InterpreterDock dock;
11
12     public DebugDock(Dock d) {
13         dock = (InterpreterDock)d;
14     }
15
16     public Dock getDock()                   { return dock; }
17     public int getOLC()                     { return dock.olc; }
18     public int getILC()                     { return dock.ilc; }
19     public Instruction getExecuting()       { return dock.executing; }
20     public Queue<Instruction> getInstructions() { return dock.instructions; }
21     public Queue<Instruction> getEpilogue() { return dock.epilogue; }
22     public boolean getDataReadyForShip()    { return dock.dataReadyForShip; }
23     public boolean getReadyForDataFromShip(){ return dock.readyForDataFromShip;}
24     public long getDataFromShip()           { return dock.dataFromShip; }
25     public boolean getTorpedoWaiting()      { return dock.torpedoWaiting; }
26     public boolean isHatchOpen()            { return dock.hatchIsOpen; }
27     public boolean getFlagA()               { return dock.flag_a; }
28     public boolean getFlagB()               { return dock.flag_b; }
29     public boolean getFlagC()               { return dock.flag_c; }
30     public BitVector getDataLatch()         { return dock.dataLatch; }
31     public Queue<BitVector> getDataDestPackets() {
32         Queue<BitVector> values = new LinkedList<BitVector>();
33         for (Packet p : dock.dataPackets) {
34             if (p.isToken())
35                 continue;
36             values.add(p.getValue());
37         }
38         return values;
39     }
40     public Queue<Instruction> getInstructionsInFabric() {
41         Queue<Instruction> instr = new LinkedList<Instruction>();
42
43         for (Instruction inst : dock.epilogue) instr.add(inst);
44
45         return instr;
46     }
47 }