From: adam Date: Mon, 3 Nov 2008 09:33:06 +0000 (+0100) Subject: add Fleet.{getShiftWidth(),getSetWidth()} X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=50064a66b302514ae6fb0d54a03b3ffafefd9800;p=fleet.git add Fleet.{getShiftWidth(),getSetWidth()} --- 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();