0646c7b18f180e3860d020383ac36d05f1b5fc35
[fleet.git] / src / edu / berkeley / fleet / interpreter / InterpreterDestination.java
1 package edu.berkeley.fleet.interpreter;
2 import edu.berkeley.fleet.api.*;
3 import java.util.*;
4
5 class InterpreterDestination extends Destination {
6
7     private static int max_dest = 0;
8
9     int addr;
10
11     Queue<Packet> packets = new LinkedList<Packet>();
12
13     private boolean isInstructionDestination;
14
15     public InterpreterDestination(InterpreterDock d, boolean isInstructionDestination) {
16         super(d);
17         this.isInstructionDestination = isInstructionDestination;
18         synchronized(InterpreterDestination.class) {
19             this.addr = max_dest;
20             max_dest++;
21         }
22     }
23
24     /** adds the included datum to the port from the switch fabric  side */
25     public void addDataFromFabric(Packet packet) {
26         packets.add(packet);
27     }
28
29     public String toString() {
30         return getDock()+(isInstructionDestination ? ":i" : "");
31     }
32 }