1 package edu.berkeley.fleet.fpga;
2 import edu.berkeley.fleet.api.*;
3 import edu.berkeley.fleet.two.*;
4 import edu.berkeley.fleet.*;
5 import java.lang.reflect.*;
8 import static edu.berkeley.fleet.two.FleetTwoFleet.*;
9 import static edu.berkeley.fleet.fpga.verilog.Verilog.*;
12 public class FpgaPath extends Path {
14 private boolean[] path;
15 private FpgaDestination dest;
16 public final BitVector signal;
18 public Dock getSource() { throw new RuntimeException("not implemented"); }
19 public Destination getDestination() { return dest; }
21 private FpgaPath(boolean[] path, FpgaDestination dest, BitVector signal) {
27 public long toLong() {
29 for(int i=0; i<path.length; i++) {
30 if (path[i]) ret |= (1 << i);
33 for(int i=0; i<signal.length(); i++) {
35 ret |= (1L << (i+11));
40 public String toString() {
41 StringBuffer ret = new StringBuffer();
42 for(int i=0; i<path.length; i++) {
43 if (i>0) ret.append('_');
44 ret.append(path[i] ? "1" : "0");
46 return ret.toString()+(signal==null?"":(":"+signal));
49 public FpgaPath prepend(boolean b) {
50 boolean[] newpath = new boolean[path.length+1];
51 System.arraycopy(path, 0, newpath, 1, path.length);
53 return new FpgaPath(newpath, dest, signal);
55 public FpgaPath append(boolean b, FpgaDestination newdest) {
56 boolean[] newpath = new boolean[path.length+1];
57 System.arraycopy(path, 0, newpath, 0, path.length);
58 newpath[newpath.length-1] = b;
59 return new FpgaPath(newpath, newdest, signal);
62 public int getBufferingAmount() {
63 throw new RuntimeException("not implemented");
66 public int getLatencyMetric() {
70 public static FpgaPath emptyPath(FpgaDestination dest, BitVector signal) {
71 return new FpgaPath(new boolean[0], dest, signal);
74 public BitVector getSignal() { return null; }