-package edu.berkeley.obits;
+package edu.berkeley.slipway;
import edu.berkeley.slipway.*;
import com.atmel.fpslic.*;
import static com.atmel.fpslic.FpslicConstants.*;
-import static com.atmel.fpslic.Fpslic.Util.*;
-import edu.berkeley.obits.device.atmel.*;
-import edu.berkeley.obits.gui.*;
+import static com.atmel.fpslic.FpslicUtil.*;
+import edu.berkeley.slipway.gui.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.color.*;
import java.util.*;
import gnu.io.*;
-public class AtmelSerial {
+public class Demo {
//public static boolean mullers = false;
public static boolean mullers = true;
Enumeration e = CommPortIdentifier.getPortIdentifiers();
while(e.hasMoreElements()) {
CommPortIdentifier cpi = (CommPortIdentifier)e.nextElement();
- Log.info(AtmelSerial.class, "trying " + cpi.getName());
+ Log.info(Demo.class, "trying " + cpi.getName());
if (cpi.getName().startsWith("/dev/cu.usbserial-"))
return new RXTXPort(cpi.getName());
if (cpi.getName().startsWith("/dev/ttyS0"))
return new RXTXPort(cpi.getName());
}
- Log.info(AtmelSerial.class, "returning null...");
+ Log.info(Demo.class, "returning null...");
return null;
}
public static int PIPELEN=20;
Fpslic at40k = device;
try {
long begin = System.currentTimeMillis();
- device.readMode4(new ProgressInputStream("configuring fabric", System.in, 111740));
+ FpslicUtil.readMode4(new ProgressInputStream("configuring fabric", System.in, 111740), device);
long end = System.currentTimeMillis();
- Log.info(AtmelSerial.class, "finished in " + ((end-begin)/1000) + "s");
+ Log.info(Demo.class, "finished in " + ((end-begin)/1000) + "s");
Thread.sleep(1000);
- Log.info(AtmelSerial.class, "issuing command");
+ Log.info(Demo.class, "issuing command");
//at40k.iob_top(2, true).oe(false);
//at40k.iob_top(2, false).oe(false);
vis.repaint();
fr.repaint();
fr.show();
- synchronized(AtmelSerial.class) { AtmelSerial.class.wait(); }
+ synchronized(Demo.class) { Demo.class.wait(); }
device.flush();
Thread.sleep(3000);
- Log.info(AtmelSerial.class, "issuing command");
+ Log.info(Demo.class, "issuing command");
at40k.iob_top(1, true).pulldown();
device.flush();
*/
- Log.info(AtmelSerial.class, "done");
+ Log.info(Demo.class, "done");
System.exit(0);
} catch (Exception e) { e.printStackTrace(); }
}
case NW: case NE: case SW: case SE: {
c.xi(in);
loopback(c, XLUT);
- if (!falling) c.ylut(lutSwap(0x0C)); /* x & !z */
- else c.ylut(lutSwap(0x30)); /* !x & z */
+ if (!falling) c.ylut(FpslicUtil.lutSwap(0x0C)); /* x & !z */
+ else c.ylut(FpslicUtil.lutSwap(0x30)); /* !x & z */
c.xlut(LUT_SELF);
break;
}
loopback(cell, YLUT);
if (!invert) cell.ylut(0xB8); /* yo = x ? yi : z => 1011 1000 */
else cell.ylut(0x74); /* yo = x ? !yi : z => 0111 0100 */
- if (!invert) cell.xlut(lutSwap(0xB8)); /* yo = x ? yi : z => 1011 1000 */
- else cell.xlut(lutSwap(0x74)); /* yo = x ? !yi : z => 0111 0100 */
+ if (!invert) cell.xlut(FpslicUtil.lutSwap(0xB8)); /* yo = x ? yi : z => 1011 1000 */
+ else cell.xlut(FpslicUtil.lutSwap(0x74)); /* yo = x ? !yi : z => 0111 0100 */
cell.xi(xi);
cell.yi(yi);
}