## Fleeterpreter ##############################################################################
-cp = -cp fleet.jar:lib/RXTXcomm.jar
+ifeq ($(impl),ml509)
+java = java -Xmx500m -Dfleet.impl=edu.berkeley.fleet.fpga.Fpga
+else
+ifeq ($(impl),java)
+java = java -Xmx500m -Dfleet.impl=edu.berkeley.fleet.interpreter.Interpreter
+else
java = java -Xmx500m
+endif
+endif
+
+cp = -cp fleet.jar:lib/RXTXcomm.jar
run: fleet.jar; $(java) $(cp) $(interpreter_class)
cd build/class/; jar xf ../../lib/edu.berkeley.sbp.jar
cd build/class/; jar xf ../../lib/ibex.jar
for A in `find ships -name \*.ship`;\
- do java -cp fleet.jar:build/class edu.berkeley.fleet.Main expand $$A;\
+ do $(java) -cp fleet.jar:build/class edu.berkeley.fleet.Main expand $$A;\
done
javac -classpath lib/com.sun.async.test.jar:lib/ibex.jar:lib/RXTXcomm.jar:build/class${ps}lib/edu.berkeley.sbp.jar -d build/class/ `find build/java -name \*.java`
echo 'Main-Class: edu.berkeley.fleet.Main' > build/class/manifest
$(java) $(cp) edu.berkeley.fleet.fpga.Fpga build/fpga/
cp src/edu/berkeley/fleet/fpga/* build/fpga || true
for A in `find ships -name \*.ship`;\
- do java -cp build/class edu.berkeley.fleet.Main target=fpga expand $$A;\
+ do $(java) -cp build/class edu.berkeley.fleet.Main target=fpga expand $$A;\
done
ssh ${host} 'mkdir -p ${remote_dir}'
${rsync} --delete ./ ${host}:${remote_dir}
runserver: fleet.jar
- java -Djava.library.path=lib -cp fleet.jar:lib/RXTXcomm.jar edu.berkeley.fleet.fpga.Server
+ $(java) -Djava.library.path=lib -cp fleet.jar:lib/RXTXcomm.jar edu.berkeley.fleet.fpga.Server
test: fleet.jar
$(java) -jar fleet.jar test ships/*.ship tests
- java -cp fleet.jar edu.berkeley.fleet.dataflow.MergeSort interpreter Memory 0 256
-testfpga: fleet.jar
- $(java) -jar fleet.jar target=fpga test ships/*.ship tests
- java -cp fleet.jar edu.berkeley.fleet.dataflow.MergeSort fpga Memory 0 256
+ $(java) -cp fleet.jar edu.berkeley.fleet.dataflow.MergeSort Memory 0 256
## Manual ####################################################################################
export PATH=/proj/async/cad/linux/bin/:$$PATH; \
/proj/async/cad/linux/lib/jdk1.5.0_05-linux-i586/bin/java \
-cp `pwd`/../../../lib/com.sun.async.test.jar:`pwd`/../../../fleet.jar \
+ -Dfleet.impl=com.sun.vlsi.chips.marina.test.Marina \
com.sun.vlsi.chips.marina.test.MarinaTest \
-hsim \
-testNum ${testnum} || tail -n 20 marina.spi.run
/proj/async/cad/linux/lib/jdk1.5.0_05-linux-i586/bin/java \
-cp `pwd`/../../../lib/com.sun.async.test.jar:`pwd`/../../../fleet.jar \
-Djava.library.path=/proj/async/cad/test/ \
+ -Dfleet.impl=com.sun.vlsi.chips.marina.test.Marina \
com.sun.vlsi.chips.marina.test.MarinaTest \
-silicon \
-testNum ${testnum}
electric:
${electric} chips/marina/electric/aMarinaM.jelib
-chaing:
- java -cp lib/com.sun.async.test.jar com.sun.async.test.ChainG chips/marina/testCode/marina.xml
-
sync:
${rsync} ${sun_server}:fleet/chips/marina/testCode/marina\*.dump ~/ || true
${rsync} ${sun_server}:fleet/chips/marina/testCode/marina.spi.out ~/${modname}.out || true
}
String target = options.get("target");
- Fleet fleet;
- if ("fpga".equals(target)) {
- String bitfile = options.get("bitfile");
- fleet = new Fpga();
- } else if ("sim".equals(target) || "fleetsim".equals(target)) {
- fleet = (Fleet)Class.forName("com.sunlabs.fleetsim.fleet.FleetDescription").newInstance();
- } else if (command.equals("expand")) {
- fleet = new Interpreter(new String[0], false);
- } else {
- fleet = new Interpreter();
- }
+ Fleet fleet = Fleet.getDefaultImpl();
if (!"yes".equals(options.get("verbose")))
Log.log = null;
public FleetProcess run(Instruction[] program) {
throw new RuntimeException("class " + this.getClass().getName() + " does not implement method run()");
}
+
+ /** Assumes that the system property "fleet.impl" holds the name of a subclass to instantiate */
+ public static Fleet getDefaultImpl() {
+ String impl = System.getProperty("fleet.impl");
+ if (impl==null) throw new RuntimeException("You must invoke the JVM with -Dfleet.impl=<impl>");
+ try {
+ return (Fleet)Class.forName(impl).newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
}
}
public static void main(String[] s) throws Exception {
- if (s.length != 4) {
- System.err.println("usage: java " + MergeSort.class.getName() + " <target> <shipname> <base> <length>");
+ if (s.length != 3) {
+ System.err.println("usage: java " + MergeSort.class.getName() + " <shipname> <base> <length>");
System.exit(-1);
}
- Fleet fleet = null;
- if (s[0].equals("fpga")) fleet = new Fpga();
- else if (s[0].equals("interpreter")) {
- fleet = new Interpreter();
- Log.log = null;
- }
+ Fleet fleet = Fleet.getDefaultImpl();
ShipPool pool = new ShipPool(fleet);
- Ship memory = pool.allocateShip(s[1]);
- int base = Integer.parseInt(s[2]);
- int length = Integer.parseInt(s[3]);
+ Ship memory = pool.allocateShip(s[0]);
+ int base = Integer.parseInt(s[1]);
+ int length = Integer.parseInt(s[2]);
Random random = new Random(System.currentTimeMillis());
BitVector[] vals = new BitVector[length];
import edu.berkeley.fleet.loops.*;
import edu.berkeley.fleet.api.*;
import edu.berkeley.fleet.fpga.*;
+import edu.berkeley.fleet.interpreter.*;
import org.ibex.graphics.*;
public class SortingDemo {
}
public static long timeit(int count, int inflight) throws Exception {
- Fleet fleet = new Fpga();
+ Fleet fleet = Fleet.getDefaultImpl();
FleetProcess fp = fleet.run(new Instruction[0]);
ShipPool pool = new ShipPool(fleet);
//Program program = new Program(pool.allocateShip("Memory"));
lf.collectWord();
lf.sendWord(debug.getDock("in"));
- FpgaDock out = (FpgaDock)counter1.getDock("out");
- FpgaDock in = (FpgaDock)counter2.getDock("in2");
- System.out.println("distance is " + out.getPathLength((FpgaDestination)in.getDataDestination()));
- System.out.println("reverse distance is " + in.getPathLength((FpgaDestination)out.getDataDestination()));
+ Dock out = (Dock)counter1.getDock("out");
+ Dock in = (Dock)counter2.getDock("in2");
+ //System.out.println("distance is " + out.getPathLength((FpgaDestination)in.getDataDestination()));
+ //System.out.println("reverse distance is " + in.getPathLength((FpgaDestination)out.getDataDestination()));
for(Instruction i : cb.emit()) System.out.println(i);
cb.dispatch(fp, true);
public static long mergeSort(int vals_length, int inflight, String shipType, int clearAmount) throws Exception {
Node.CAPACITY = inflight;
- Fleet fleet = new Fpga();
+ Fleet fleet = Fleet.getDefaultImpl();
FleetProcess fp = fleet.run(new Instruction[0]);
ShipPool pool = new ShipPool(fleet);
Ship mem1 = pool.allocateShip(shipType);
-
if (clearAmount > 0)
randomizeMemory(fp, pool, mem1, 0, clearAmount, false);
import java.net.*;
import edu.berkeley.fleet.two.*;
import edu.berkeley.fleet.fpga.*;
+import edu.berkeley.fleet.interpreter.*;
import edu.berkeley.fleet.api.*;
import edu.berkeley.fleet.api.Instruction.*;
import edu.berkeley.fleet.api.Instruction.Set;
public static void main(String[] s) throws Exception {
Random random = new Random(System.currentTimeMillis());
- Fleet fleet = new Fpga();
+ Fleet fleet = Fleet.getDefaultImpl();
FleetProcess fp = fleet.run(new Instruction[0]);
- Ship memory = fleet.getShip("DDR2",0);
- //Ship memory = fleet.getShip("Dvi",0);
- //Ship memory = fleet.getShip("Memory",0);
+ Ship memory = fleet.getShip(s[0],0);
//int size = (548 * 478) / 2;
int size = 2048;