package edu.berkeley.slipway;
-import edu.berkeley.obits.*;
-import org.ibex.util.Log;
import java.io.*;
import java.util.*;
-import gnu.io.*;
+import com.ftdi.usb.*;
+import com.atmel.fpslic.*;
+import edu.berkeley.abits.*;
+import org.ibex.util.*;
-public class FakeBoard implements Board {
+// FEATURE: more state checking (ie must have reset high before uart-mode, etc)
- public FakeBoard() {
-
+/**
+ * Slipway board (Fpslic via FTDI USB-UART, running <tt>SlipwaySlave.c</tt>)
+ */
+public class FakeBoard extends FpslicDevice implements Board {
+
+ private byte[][][] cache;
+ public FakeBoard(int width, int height) {
+ super(width, height);
+ cache = new byte[256][][];
+ for(int i=0; i < cache.length; i++) {
+ cache[i] = new byte[256][];
+ for(int j=0; j < cache.length; j++) {
+ cache[i][j] = new byte[256];
+ }
+ }
+ }
+
+ public void flush() { }
+ public void mode4(int z, int y, int x, int d) {
+ cache[z][y][x] = (byte)d;
+ }
+ public byte mode4(int z, int y, int x) {
+ return cache[z][y][x];
+ }
+
+ public void reset() throws IOException { }
+
+ public OutputStream getConfigStream() throws IOException {
+ return new OutputStream() {
+ public void flush() { }
+ public void write(int b) { }
+ public void write(byte[] b, int x, int y) { }
+ };
}
- public void reset() {
- System.err.println("FakeBoard: reset()");
+ public InputStream getInputStream() throws IOException {
+ return new InputStream() {
+ public int available() { return 0; }
+ public int read() { return -1; }
+ public int read(byte[] b, int x, int y) { return -1; }
+ };
}
- public void boot(Reader r) throws Exception {
+ public OutputStream getOutputStream() throws IOException {
+ return new OutputStream() {
+ public void flush() { }
+ public void write(int b) { }
+ public void write(byte[] b, int x, int y) { }
+ };
}
- public InputStream getInputStream() { throw new Error(); }
- public OutputStream getOutputStream() { throw new Error(); }
+
+ public void selfTest(SelfTestResultListener resultListener) throws Exception { }
+
+ public Device getDevice() { return this; }
}
+