public class InstructionFactory
extends java.lang.Object
Constructor and Description |
---|
InstructionFactory() |
Modifier and Type | Method and Description |
---|---|
static Computation |
newComputation(int clockCycles)
Create an instance of a
computation instruction |
static Loop |
newLoop(int numIterations,
InstructionList instructionList)
Create an instance of a
loop instruction |
static MemoryAccess |
newMemoryLoad(long address)
Create an instance of a
load instruction |
static MemoryAccess |
newMemoryStore(long address)
Create an instance of a
store instruction |
static SysCall |
newSysCall(java.lang.String sysCall,
int[] arguments)
Create an instance of a
syscall instruction |
public static Computation newComputation(int clockCycles)
computation instruction
clockCycles
- Clock cycles the computation takesconfigured computation class
public static SysCall newSysCall(java.lang.String sysCall, int[] arguments) throws NoSuchSysCallException
syscall instruction
sysCall
- The number/identifier of the system callarguments
- The arguments of the system callconfigured system call class
NoSuchSysCallException
- No such system call exceptionpublic static MemoryAccess newMemoryLoad(long address)
load instruction
address
- The source addressconfigured memory load class
public static MemoryAccess newMemoryStore(long address)
store instruction
address
- The destination addressconfigured memory store class
public static Loop newLoop(int numIterations, InstructionList instructionList)
loop instruction
numIterations
- Number of iterationsinstructionList
- The body of the loopclass