From 50064a66b302514ae6fb0d54a03b3ffafefd9800 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 3 Nov 2008 10:33:06 +0100 Subject: [PATCH] add Fleet.{getShiftWidth(),getSetWidth()} --- src/edu/berkeley/fleet/api/Fleet.java | 6 ++++++ src/edu/berkeley/fleet/two/FleetTwoFleet.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/edu/berkeley/fleet/api/Fleet.java b/src/edu/berkeley/fleet/api/Fleet.java index 48651f0..299f59d 100644 --- a/src/edu/berkeley/fleet/api/Fleet.java +++ b/src/edu/berkeley/fleet/api/Fleet.java @@ -30,6 +30,12 @@ public abstract class Fleet implements Iterable { /** the natural word width of this machine */ public abstract int getWordWidth(); + /** the width of the immediate field in the "shift data latch" instruction */ + public abstract int getShiftWidth(); + + /** the width of the immediate field in the "set data latch" instruction */ + public abstract int getSetWidth(); + /** * Read a machine-formatted instruction from a file. * @is The stream to read from. diff --git a/src/edu/berkeley/fleet/two/FleetTwoFleet.java b/src/edu/berkeley/fleet/two/FleetTwoFleet.java index e6af7f8..93f145e 100644 --- a/src/edu/berkeley/fleet/two/FleetTwoFleet.java +++ b/src/edu/berkeley/fleet/two/FleetTwoFleet.java @@ -128,6 +128,10 @@ public abstract class FleetTwoFleet extends Fleet { } } + public int getShiftWidth() { return SHIFT.valmaskwidth; } + public int getSetWidth() { return SET_IMMEDIATE.valmaskwidth+1; } + + // FIXME: should use BitVector here public Instruction readInstruction(long inst, Dock dispatchFrom) { Dock dock = getPathByAddr(dispatchFrom, DISPATCH_PATH.getval(inst)).getDestination().getDock(); -- 1.7.10.4