public final class Executor
extends java.lang.Object
Executor
class is to execute (simulate) sequences of instruction calls
(concrete calls). It executes instruction by instruction, perform control transfers by labels
(if needed) and prints information about important events to the simulator log (currently,
the console).Modifier and Type | Class and Description |
---|---|
static interface |
Executor.Listener
The
Executor.Listener interface is to be implemented by classes that monitor
execution of instruction calls. |
Constructor and Description |
---|
Executor(EngineContext context)
Constructs an Executor object.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(ExecutorCode executorCode,
java.util.List<ConcreteCall> sequenceCode,
int sequenceIndex,
boolean abortOnUndefinedLabel)
Executes the specified sequence of instruction calls (concrete calls) and prints information
about important events to the simulator log.
|
void |
setExceptionHandlers(java.util.Map<java.lang.String,java.util.List<ConcreteCall>> handlers) |
void |
setListener(Executor.Listener listener) |
public Executor(EngineContext context)
context
- Generatio engine context.java.lang.IllegalArgumentException
- if the argument is null
.public void setExceptionHandlers(java.util.Map<java.lang.String,java.util.List<ConcreteCall>> handlers)
public void setListener(Executor.Listener listener)
public void execute(ExecutorCode executorCode, java.util.List<ConcreteCall> sequenceCode, int sequenceIndex, boolean abortOnUndefinedLabel)
executorCode
- Execution context that contains all code of the current test program.sequenceCode
- Sequence of executable (concrete) instruction calls.sequenceIndex
- Sequence index.abortOnUndefinedLabel
- Aborts generation when a reference to an undefined label is
detected. This is the default behavior, which can changed in special cases (e.g.
self-checks that contain references to labels defined in epilogue).java.lang.IllegalArgumentException
- if the parameter is null
.GenerationAbortedException
- if during the interaction with the microprocessor model
an error caused by an invalid format of the request has occurred (typically, it
happens when evaluating an Output
object causes an invalid request to the
model state observer).