From: adam Date: Wed, 7 Jun 2006 07:14:35 +0000 (+0100) Subject: checkpoint X-Git-Tag: mpar_demo_release~116 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=dc444e43bdc1be2860290976743dce23cd9f6b8a;p=slipway.git checkpoint --- diff --git a/src/edu/berkeley/obits/AtmelSerial.java b/src/edu/berkeley/obits/AtmelSerial.java index 114adf8..a67d936 100644 --- a/src/edu/berkeley/obits/AtmelSerial.java +++ b/src/edu/berkeley/obits/AtmelSerial.java @@ -222,6 +222,7 @@ public class AtmelSerial { } */ + /* LAST System.out.println("doit"); if (mullers) doitx(at40k, device); //System.out.println("counter"); @@ -232,11 +233,133 @@ public class AtmelSerial { at40k.cell(22,15).yi(WEST); at40k.cell(22,15).ylut(0xAA); - + */ at40k.cell(23,15).h(3, true); at40k.cell(23,15).yi(L3); at40k.cell(23,15).ylut(0xAA); at40k.iob_right(15, true).enableOutput(WEST); + + + At40k.Cell c = at40k.cell(10,10); + c.ylut(~LUT_SELF); + c.xlut(LUT_Z); + c.yi(WEST); + c.c(YLUT); + c.f(false); + c.t(TMUX_FB); + copy(c.west(), EAST, NW); + copy(c.west().north().west(), SE, SE); + + c = c.east(); + c.ylut(~LUT_SELF); + c.xlut(LUT_Z); + c.yi(EAST); + c.c(YLUT); + c.f(false); + c.t(TMUX_FB); + copy(c.east(), WEST, SE); + copy(c.east().south().east(), NW, NW); + + c = c.north(); + copy(c.north(), SOUTH, SOUTH); + c.xlut((LUT_SELF & ~LUT_OTHER) | LUT_Z); + c.ylut(LUT_Z); + c.yi(SOUTH); + c.c(XLUT); + c.xi(SW); + c.wi(L4); + c.f(false); + c.t(TMUX_W_AND_FB); + c.v(L4, false); + c.h(L4, true); + c.v(L2, false); + c.h(L2, true); + + c = c.west(); + copy(c.north(), SOUTH, SOUTH); + c.xlut((LUT_SELF & ~LUT_OTHER) | LUT_Z); + c.ylut(~LUT_Z); + c.yi(SOUTH); + c.xi(SE); + c.c(XLUT); + c.wi(L4); + c.f(false); + c.t(TMUX_W_AND_FB); + c.v(L4, false); + c.h(L4, true); + c.v(L2, false); + c.h(L2, true); + + c = c.west(); + c.v(L4, false); + c.h(L4, true); + c.out(L4, true); + c.f(false); + c.b(false); + c.oe(NONE); + c.c(YLUT); + c.hwire(L4).west().drives(c.hwire(L4), false); + c.hwire(L4).east().drives(c.hwire(L4), false); + + c = c.south(); + c = c.south(); + c.v(L4, false); + c.h(L4, true); + c.out(L4, true); + c.f(false); + c.b(false); + c.oe(NONE); + c.c(YLUT); + c.hwire(L4).west().drives(c.hwire(L4), false); + c.hwire(L4).east().drives(c.hwire(L4), false); + + c = c.east(); + c = c.east(); + copy(c.south(), NORTH, NORTH); + c.xlut(((~LUT_SELF) & (~LUT_OTHER)) | LUT_Z); + c.ylut(LUT_Z); + c.yi(NORTH); + c.c(XLUT); + c.xi(NW); + c.wi(L4); + c.f(false); + c.t(TMUX_W_AND_FB); + c.v(L4, false); + c.h(L4, true); + c.v(L2, false); + c.h(L2, true); + + c = c.west(); + copy(c.south(), NORTH, NORTH); + c.xlut((LUT_SELF & LUT_OTHER) | LUT_Z); + c.ylut(LUT_Z); + c.yi(NORTH); + c.xi(NE); + c.c(XLUT); + c.wi(L4); + c.f(false); + c.t(TMUX_W_AND_FB); + c.v(L4, false); + c.h(L4, true); + c.v(L2, false); + c.h(L2, true); + + + + // catch a rising transition + /* + c = c.west(); + c.v(L2, false); + c.h(L2, true); + c.out(L2, true); + c.f(false); + c.b(false); + c.oe(NONE); + c.c(YLUT); + */ + c.hwire(L2).west().drives(c.hwire(L2), false); + c.hwire(L2).east().drives(c.hwire(L2), false); + //for(int x=5; x you can't! this is a false connection in my diagram // what does it mean for both bits (0x30) to be set to 1? - if (fb && z) throw new RuntimeException("invalid combination"); + //if (fb && z) throw new RuntimeException("invalid combination"); int result = 0; - if (z) result |= 0x20; - if (fb) result |= 0x10; - dev.mode4(1, row, col, result, 0x30); + // ZM->FB = 0x04 + // FB->WM = 0x10 + // WZ->WM = 0x20 + + // tff => w&z + // fff => w + // ttt => fb&w + // ftt => fb&w + // fft => fb&w + + // ttf => w&z + // ftf => w + // tft => fb&w + if (ignore_z_and_fb) result |= 0x20; + if (zm_drives_fb) result |= 0x04; + if (fb_drives_wm) result |= 0x10; + dev.mode4(1, row, col, result, 0x34); } public void c(int source) { diff --git a/src/edu/berkeley/obits/device/atmel/AtmelDevice.java b/src/edu/berkeley/obits/device/atmel/AtmelDevice.java index 03db123..50c5c47 100644 --- a/src/edu/berkeley/obits/device/atmel/AtmelDevice.java +++ b/src/edu/berkeley/obits/device/atmel/AtmelDevice.java @@ -57,6 +57,12 @@ public abstract class AtmelDevice extends Bits implements Device { public static final int LUT_SELF = 0xAA; public static final int LUT_Z = 0xF0; public static final int LUT_OTHER = 0xCC; + + public static final int TMUX_W_AND_Z = 0x00001001; + public static final int TMUX_W = 0x00001002; + public static final int TMUX_Z = 0x00001004; + public static final int TMUX_W_AND_FB = 0x00001008; + public static final int TMUX_FB = 0x00001010; } /** issue a command to the device in Mode4 format; see Gosset's documentation for further details */