cleanup in Process.java
authoradam <adam@megacz.com>
Tue, 18 Nov 2008 02:46:13 +0000 (03:46 +0100)
committeradam <adam@megacz.com>
Tue, 18 Nov 2008 02:46:13 +0000 (03:46 +0100)
src/edu/berkeley/fleet/ir/Process.java

index 724386d..017b17f 100644 (file)
@@ -634,7 +634,6 @@ public class Process {
         int num_strides = end_of_data / (stride_length * 2);
 
         MemoryModule mm  = proc.new MemoryModule(memoryShip1);
-        MemoryModule mm2 = proc.new MemoryModule(memoryShip2);
         SortedMergeModule sm = proc.new SortedMergeModule();
 
         // So far: we have four spare Counter ships; one can be used for resetting
@@ -650,8 +649,8 @@ public class Process {
 
             c1.start.connect(proc.new OnceModule(end_of_data + i*stride_length).out);
             c1.incr.connect(proc.new OnceModule(stride_length*2).out);
-            c1.out.connect(r1.val);
 
+            r1.val.connect(c1.out);
             r1.count.connect(proc.new ForeverModule(stride_length).out);
 
             alu.in1.connect(r1.out);
@@ -659,23 +658,24 @@ public class Process {
             alu.inOp.connect(proc.new ForeverModule(2 /* ADD */).out);
             alu.out.connect(i==0 ? mm.inAddrRead1 : mm.inAddrRead2);
 
-            ForeverModule fm = proc.new ForeverModule(stride_length);
             PunctuatorModule punc = proc.new PunctuatorModule(-1);
-            fm.out.connect(punc.count);
-            (i==0 ? mm.outRead1 : mm.outRead2).connect(punc.val);
+            punc.count.connect(proc.new ForeverModule(stride_length).out);
+            punc.val.connect(i==0 ? mm.outRead1 : mm.outRead2);
             punc.out.connect(i==0 ? sm.in1 : sm.in2);
         }
 
-        ForeverModule fm = proc.new ForeverModule(2*stride_length);
+        
         UnPunctuatorModule unpunc = proc.new UnPunctuatorModule();
-        sm.out.connect(unpunc.val);
-        fm.out.connect(unpunc.count);
+        unpunc.val.connect(sm.out);
+        unpunc.count.connect(proc.new ForeverModule(2*stride_length).out);
 
         DownCounterModule cw = proc.new DownCounterModule();
-        proc.new OnceModule(end_of_data).out.connect(cw.start);
-        proc.new OnceModule(1).out.connect(cw.incr);
-        cw.out.connect(mm2.inAddrWrite);
-        unpunc.out.connect(mm2.inDataWrite);
+        cw.start.connect(proc.new OnceModule(end_of_data).out);
+        cw.incr.connect(proc.new OnceModule(1).out);
+
+        MemoryModule mm2 = proc.new MemoryModule(memoryShip2);
+        mm2.inAddrWrite.connect(cw.out);
+        mm2.inDataWrite.connect(unpunc.out);
         mm2.outWrite.connect(dm.in);
  
         //////////////////////////////////////////////////////////////////////////////