|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
mars.simulator.Simulator
public class Simulator
Used to simulate the execution of an assembled MIPS program.
| Nested Class Summary | |
|---|---|
static interface |
Simulator.StopListener
|
| Field Summary | |
|---|---|
static int |
BREAKPOINT
various reasons for simulate to end... |
static int |
CLIFF_TERMINATION
|
static int |
EXCEPTION
|
static int |
externalInterruptingDevice
|
static int |
MAX_STEPS
|
static int |
NO_DEVICE
|
static int |
NORMAL_TERMINATION
|
static int |
PAUSE_OR_STOP
|
| Method Summary | |
|---|---|
void |
addStopListener(Simulator.StopListener l)
|
static Simulator |
getInstance()
Returns the Simulator object |
static boolean |
inDelaySlot()
Determine whether or not the next instruction to be executed is in a "delay slot". |
void |
removeStopListener(Simulator.StopListener l)
|
boolean |
simulate(MIPSprogram p,
int pc,
int maxSteps,
int[] breakPoints,
AbstractAction actor)
Simulate execution of given MIPS program. |
void |
stopExecution(AbstractAction actor)
Set the volatile stop boolean variable checked by the execution thread at the end of each MIPS instruction execution. |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_DEVICE
public static volatile int externalInterruptingDevice
public static final int BREAKPOINT
public static final int EXCEPTION
public static final int MAX_STEPS
public static final int NORMAL_TERMINATION
public static final int CLIFF_TERMINATION
public static final int PAUSE_OR_STOP
| Method Detail |
|---|
public static Simulator getInstance()
public static boolean inDelaySlot()
public boolean simulate(MIPSprogram p,
int pc,
int maxSteps,
int[] breakPoints,
AbstractAction actor)
throws ProcessingException
p - The MIPSprogram to be simulated.pc - address of first instruction to simulate; this goes into program countermaxSteps - maximum number of steps to perform before returning false (0 or less means no max)breakPoints - array of breakpoint program counter values, use null if noneactor - the GUI component responsible for this call, usually GO or STEP. null if none.
ProcessingException - Throws exception if run-time exception occurs.public void stopExecution(AbstractAction actor)
public void addStopListener(Simulator.StopListener l)
public void removeStopListener(Simulator.StopListener l)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||