add FpgaDestination.getPathLength() for measuring hop counts
[fleet.git] / src / edu / berkeley / fleet / fpga / FabricElement.java
index bcf44b7..c340c99 100644 (file)
@@ -16,6 +16,7 @@ import static edu.berkeley.fleet.fpga.verilog.Verilog.*;
 public interface FabricElement {
 
     public FpgaPath getPath(FpgaDestination dest, BitVector signal);
+    public int      getPathLength(FpgaDestination dest);
 
     public void addInput(FabricElement in, Module.Port inPort);
     public void addOutput(FabricElement out, Module.Port outPort);
@@ -25,6 +26,7 @@ public interface FabricElement {
 
     public static abstract class AbstractFabricElement implements FabricElement {
         public abstract FpgaPath getPath(FpgaDestination dest, BitVector signal);
+        public abstract int getPathLength(FpgaDestination dest);
         public void addInput(FabricElement in, Module.Port inPort) { throw new RuntimeException(); }
         public void addOutput(FabricElement out, Module.Port outPort) { throw new RuntimeException(); }
         public Module.SourcePort getOutputPort() { throw new RuntimeException(); }