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.*;
6 import edu.berkeley.sbp.chr.*;
7 import edu.berkeley.sbp.misc.*;
8 import edu.berkeley.sbp.meta.*;
9 import edu.berkeley.sbp.util.*;
12 import static edu.berkeley.fleet.two.FleetTwoFleet.*;
13 import static edu.berkeley.fleet.fpga.verilog.Verilog.*;
16 public class FpgaPath extends Path {
18 private boolean[] path;
19 private FpgaDestination dest;
20 public final BitVector signal;
22 public Dock getSource() { throw new RuntimeException("not implemented"); }
23 public Destination getDestination() { return dest; }
25 private FpgaPath(boolean[] path, FpgaDestination dest, BitVector signal) {
31 public long toLong() {
33 for(int i=0; i<path.length; i++) {
34 if (path[i]) ret |= (1 << i);
37 for(int i=0; i<signal.length(); i++) {
39 ret |= (1L << (i+11));
44 public String toString() {
45 StringBuffer ret = new StringBuffer();
46 for(int i=0; i<path.length; i++) {
47 if (i>0) ret.append('_');
48 ret.append(path[i] ? "1" : "0");
50 return ret.toString()+(signal==null?"":(":"+signal));
53 public FpgaPath prepend(boolean b) {
54 boolean[] newpath = new boolean[path.length+1];
55 System.arraycopy(path, 0, newpath, 1, path.length);
57 return new FpgaPath(newpath, dest, signal);
59 public FpgaPath append(boolean b, FpgaDestination newdest) {
60 boolean[] newpath = new boolean[path.length+1];
61 System.arraycopy(path, 0, newpath, 0, path.length);
62 newpath[newpath.length-1] = b;
63 return new FpgaPath(newpath, newdest, signal);
66 public int getBufferingAmount() {
67 throw new RuntimeException("not implemented");
70 public int getLatencyMetric() {
74 public static FpgaPath emptyPath(FpgaDestination dest, BitVector signal) {
75 return new FpgaPath(new boolean[0], dest, signal);
78 public BitVector getSignal() { return null; }