switch host->fpga communication from 8-bit words to 6-bit words
[fleet.git] / src / edu / berkeley / fleet / fpga / Client.java
index 6b71a76..0048fa2 100644 (file)
@@ -75,11 +75,11 @@ public class Client extends FleetProcess {
                     while(true) {
                         long result = 0;
                         int val = 0;
-                        for(int i=0; i<6; i++) {
+                        for(int i=0; i<8; i++) {
                             val = is.read();
                             if (val==-1) break;
                             long val2 = (val & 0xffL);
-                            val2 = val2 << (i * 8);
+                            val2 = val2 << (i * 6);
                             result |= val2;
                         }
                         if (val==-1) break;
@@ -108,8 +108,8 @@ public class Client extends FleetProcess {
             out = fpga.PACKET_SIGNAL.setval(out, 0);
             out = fpga.PACKET_DEST.setval(out, ((FpgaPath)dispatchFrom.getPath(d, null)).toLong());
             synchronized(this) {
-                for(int i=7; i>=0; i--)
-                    dos.write(BitManipulations.getIntField(i*8+7, i*8, out));
+                for(int i=9; i>=0; i--)
+                    dos.write(BitManipulations.getIntField(i*6+7, i*6, out));
             }
         } catch (Exception e) {
             throw new RuntimeException(e);
@@ -121,8 +121,8 @@ public class Client extends FleetProcess {
                  new BitVector(fpga.getWordWidth()).set(fpga.writeInstruction(inst, dispatchFrom)));
     }
 
-    private static Move discard(Dock dock)           { return new Move(dock, false, IgnoreOLC, false, null, false, true,  false, false, false, false); }
-    private static Move deliver(Dock dock)           { return new Move(dock, false, IgnoreOLC, false, null, false, false, false, false, true,  false); }
-    private static Move wait(Dock dock)              { return new Move(dock, false, IgnoreOLC, false, null, true,  false, false, false, false, false); }
-    private static Move sendto(Dock dock, Path path) { return new Move(dock, false, IgnoreOLC, false, path, false, false, false, false, true,  false); }
+    private static Move discard(Dock dock)           { return new Move(dock, false, IgnoreFlagD, false, null, false, true,  false, false, false, false); }
+    private static Move deliver(Dock dock)           { return new Move(dock, false, IgnoreFlagD, false, null, false, false, false, false, true,  false); }
+    private static Move wait(Dock dock)              { return new Move(dock, false, IgnoreFlagD, false, null, true,  false, false, false, false, false); }
+    private static Move sendto(Dock dock, Path path) { return new Move(dock, false, IgnoreFlagD, false, path, false, false, false, false, true,  false); }
 }