X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Ffleet%2Fapi%2FFleet.java;h=0e9700cb03228f175ed2de8578a00e473afaad8e;hb=94b0be86c73ee62ca09c329dbc7049c7dafa8e02;hp=ce0cfb2792c0f97eca3b62c4cedc942dec374558;hpb=42514a734f7539d178763f53d487a79f75428886;p=fleet.git diff --git a/src/edu/berkeley/fleet/api/Fleet.java b/src/edu/berkeley/fleet/api/Fleet.java index ce0cfb2..0e9700c 100644 --- a/src/edu/berkeley/fleet/api/Fleet.java +++ b/src/edu/berkeley/fleet/api/Fleet.java @@ -35,6 +35,12 @@ public abstract class Fleet implements Iterable { /** the width of the immediate field in the "set data latch" instruction */ public abstract int getSetWidth(); + + /** FIXME: this will soon become a property of individual memories rather than the entire Fleet */ + public abstract int getMaxCodeBagSize(); + + /** FIXME: this will soon become a property of individual memories rather than the entire Fleet */ + public abstract BitVector makeCodeBagDescriptor(long offset, long length); /** * Encodes an instruction as a BitVector @@ -54,4 +60,16 @@ public abstract class Fleet implements Iterable { 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="); + try { + return (Fleet)Class.forName(impl).newInstance(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }