abstract class InterpreterDestination extends Destination {
- private static int max_dest = 0;
-
- int addr;
-
- private boolean isInstructionDestination;
-
- public InterpreterDestination(InterpreterDock d, boolean isInstructionDestination) {
+ public InterpreterDestination(InterpreterDock d) {
super(d);
- this.isInstructionDestination = isInstructionDestination;
- synchronized(InterpreterDestination.class) {
- this.addr = max_dest;
- max_dest++;
+ synchronized(d.getInterpreter()) {
+ this.serialNumber = d.getInterpreter().maxAllocatedDestinationSerialNumber++;
}
}
public abstract void addDataFromFabric(Packet packet);
public abstract String toString();
+ /**
+ * The Fleet instruction encoding mechanism assumes that each
+ * source->dest path can be turned into a bitstring, and that the
+ * bitstring gives sufficient information to route the packet.
+ * Therefore, the interpreter assigns a "serial number" to every
+ * InterpreterDestination in a fleet and uses the serial number
+ * of the destination as the path.
+ */
+ private int serialNumber;
+ int getSerialNumber() { return serialNumber; }
}