From a3a4863297fb93e01b87a9793c973fe21dfdbd02 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 13 Feb 2007 05:49:29 +0100 Subject: [PATCH] make bitfile= option work --- src/edu/berkeley/fleet/Main.java | 9 ++------- src/edu/berkeley/fleet/slipway/Slipway.java | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/edu/berkeley/fleet/Main.java b/src/edu/berkeley/fleet/Main.java index 7381036..2b8d0e1 100644 --- a/src/edu/berkeley/fleet/Main.java +++ b/src/edu/berkeley/fleet/Main.java @@ -34,7 +34,8 @@ public class Main { String target = options.get("target"); Fleet fleet; if ("fpga".equals(target)) { - fleet = new Slipway(); + String bitfile = options.get("bitfile"); + fleet = bitfile == null ? new Slipway() : new Slipway(bitfile); } else if ("sim".equals(target) || "fleetsim".equals(target)) { fleet = (Fleet)Class.forName("com.sunlabs.fleetsim.fleet.FleetDescription").newInstance(); } else { @@ -124,13 +125,7 @@ public class Main { if (numread==-1) break; baos.write(buf, 0, numread); } - String bitfile = options.get("bitfile"); FleetProcess client = fleet.run(baos.toByteArray()); - /* - bitfile==null - ? fleet.run(baos.toByteArray()) - : fleet.run(bitfile, baos.toByteArray()); - */ while(true) { long result = client.readWord(); System.err.print(result); diff --git a/src/edu/berkeley/fleet/slipway/Slipway.java b/src/edu/berkeley/fleet/slipway/Slipway.java index 46c9ca9..26a7dd2 100644 --- a/src/edu/berkeley/fleet/slipway/Slipway.java +++ b/src/edu/berkeley/fleet/slipway/Slipway.java @@ -16,7 +16,8 @@ import edu.berkeley.fleet.interpreter.ships.*; public class Slipway extends Interpreter { - public Slipway() { + public Slipway() { this("superbowl.bit"); } + public Slipway(String bitfile) { createShip("Alu2", "alu2a"); createShip("Alu2", "alu2b"); createShip("Alu2", "alu2c"); -- 1.7.10.4