1 package edu.berkeley.slipway;
3 import edu.berkeley.slipway.*;
4 import com.atmel.fpslic.*;
5 import static com.atmel.fpslic.FpslicConstants.*;
6 import static com.atmel.fpslic.FpslicUtil.*;
7 import edu.berkeley.slipway.gui.*;
9 import java.awt.event.*;
10 import java.awt.color.*;
11 import org.ibex.util.*;
16 public class AsyncPaperDemo {
20 public AsyncPaperDemo() throws Exception {
21 fpslic = new FtdiBoard();
24 public void main() throws Exception {
29 Fpslic.Cell root = fpslic.cell(2, 2);
31 root.yo(root.north());
41 root.yo(root.south());
50 root = fpslic.cell(3, 7);
64 root.west().out(2, true);
65 root.west().h(2, true);
68 root.west().west().out(1, true);
69 root.west().west().h(1, true);
70 root.west().west().c(YLUT);
77 private void turnOnLeds() {
78 for(int i=0; i<24; i++) {
79 fpslic.iob_bot(i, true).enableOutput(NORTH);
80 fpslic.iob_bot(i, false).enableOutput(NW);
81 fpslic.cell(i, 0).xlut(0xff);
82 fpslic.cell(i, 0).ylut(0xff);
86 private void setupScanCell() {
87 fpslic.cell(23,15).h(3, true);
88 fpslic.cell(23,15).yi(L3);
89 fpslic.cell(23,15).ylut(0xAA);
90 fpslic.iob_right(15, true).enableOutput(WEST);
93 private void runGui(int width, int height) throws Exception {
94 Gui vis = new Gui(fpslic, fpslic, width, height);
95 Frame fr = new Frame();
96 fr.addKeyListener(vis);
97 fr.setLayout(new BorderLayout());
98 fr.add(vis, BorderLayout.CENTER);
100 fr.setSize(900, 900);
104 synchronized(Demo.class) { Demo.class.wait(); }