add PercolatedPort
authorAdam Megacz <adam.megacz@sun.com>
Tue, 3 Mar 2009 20:42:15 +0000 (20:42 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Tue, 3 Mar 2009 20:42:15 +0000 (20:42 +0000)
testCode/edu/berkeley/fleet/two/PercolatedPort.java [new file with mode: 0644]
testCode/edu/berkeley/fleet/two/ShipDescription.java

diff --git a/testCode/edu/berkeley/fleet/two/PercolatedPort.java b/testCode/edu/berkeley/fleet/two/PercolatedPort.java
new file mode 100644 (file)
index 0000000..d2fd257
--- /dev/null
@@ -0,0 +1,17 @@
+package edu.berkeley.fleet.two;
+
+/**
+ *  A PercolatedPort is a connection to a top-level pin; it is
+ *  propagated up or down the hierarchy
+ */
+public class PercolatedPort {
+    public static enum PortType { UP, DOWN, INOUT };
+    public final String name;
+    public final int width;
+    public final PortType type;
+    public PercolatedPort(String name, int width, PortType type) {
+        this.name = name;
+        this.width = width;
+        this.type = type;
+    }
+}
index dbc682e..1aa801b 100644 (file)
@@ -1,6 +1,5 @@
 package edu.berkeley.fleet.two;
 import edu.berkeley.fleet.api.*;
-//import edu.berkeley.fleet.fpga.verilog.Verilog.PercolatedPort;
 import java.io.*;
 import java.util.*;
 
@@ -21,7 +20,7 @@ public class ShipDescription implements Iterable<DockDescription> {
         return ports.values();
     }
 
-    //public final LinkedList<PercolatedPort> percolatedPorts = new LinkedList<PercolatedPort>();
+    public final LinkedList<PercolatedPort> percolatedPorts = new LinkedList<PercolatedPort>();
 
     public ShipDescription(String name, BufferedReader r) throws IOException {
         if (name.endsWith(".ship")) name = name.substring(0, name.length()-".ship".length());
@@ -89,7 +88,6 @@ public class ShipDescription implements Iterable<DockDescription> {
                 else if (key.equals("in"))        { inbox = true;  }
                 else if (key.equals("dockless out")) { inbox = false; dockless = true; }
                 else if (key.equals("out"))       { inbox = false; }
-                /*
                 else if (key.startsWith("percolate")) { 
                     key = s;
                     key = key.substring("percolate".length()+1).trim();
@@ -103,7 +101,6 @@ public class ShipDescription implements Iterable<DockDescription> {
                     percolatedPorts.add(new PercolatedPort(name, width, type));
                     continue;
                 }
-                */
                 else if (key.startsWith("constant")) {
                     String constname = key.substring("constant".length()+1).trim();
                     String val       = s.substring(s.indexOf(':')+1).trim();