1 package edu.berkeley.slipway;
6 import com.atmel.fpslic.*;
7 import edu.berkeley.abits.*;
8 import org.ibex.util.*;
10 // FEATURE: more state checking (ie must have reset high before uart-mode, etc)
13 * Slipway board (Fpslic via FTDI USB-UART, running <tt>SlipwaySlave.c</tt>)
15 public class FakeBoard extends FpslicDevice implements Board {
17 private byte[][][] cache;
18 public FakeBoard(int width, int height) {
20 cache = new byte[256][][];
21 for(int i=0; i < cache.length; i++) {
22 cache[i] = new byte[256][];
23 for(int j=0; j < cache.length; j++) {
24 cache[i][j] = new byte[256];
29 public void flush() { }
30 public void mode4(int z, int y, int x, int d) {
31 cache[z][y][x] = (byte)d;
33 public byte mode4(int z, int y, int x) {
34 return cache[z][y][x];
37 public void reset() throws IOException { }
39 public OutputStream getConfigStream() throws IOException {
40 return new OutputStream() {
41 public void flush() { }
42 public void write(int b) { }
43 public void write(byte[] b, int x, int y) { }
47 public InputStream getInputStream() {
48 return new InputStream() {
49 public int available() { return 0; }
50 public int read() { return -1; }
51 public int read(byte[] b, int x, int y) { return -1; }
55 public OutputStream getOutputStream() {
56 return new OutputStream() {
57 public void flush() { }
58 public void write(int b) { }
59 public void write(byte[] b, int x, int y) { }
63 //public void selfTest(SelfTestResultListener resultListener) throws Exception { }
65 public Device getDevice() { return this; }
67 public void boot(Reader r) throws Exception { }