Package ru.ispras.microtesk.model
Class InstructionCall
- java.lang.Object
-
- ru.ispras.microtesk.model.InstructionCall
-
public final class InstructionCall extends java.lang.Object
TheInstructionCall
class provides methods to run execution simulation of some instruction within the processor model.
-
-
Constructor Summary
Constructors Constructor Description InstructionCall(TemporaryVariables temporaryVariables, IsaPrimitive instruction)
Creates an instruction call object based on an nML operation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(ProcessingElement processingElement)
Runs simulation of a corresponding instruction described within the model.int
getByteSize()
Returns the size of the instruction in bytes.java.lang.String
getImage()
Returns image (binary representation) of the instruction call.IsaPrimitive
getRootPrimitive()
Returns the root of the primitive tree that describes the instruction.java.lang.String
getText()
Return the assembly code for the specified call (for example, the addition instruction of a MIPS processor: addu $1, $1, $2).java.lang.String
toString()
-
-
-
Constructor Detail
-
InstructionCall
public InstructionCall(TemporaryVariables temporaryVariables, IsaPrimitive instruction)
Creates an instruction call object based on an nML operation. The operation usually represents a composite object encapsulating a hierarchy of aggregated operations that make up a microprocessor instruction.- Parameters:
instruction
- The root operation of the nML operation hierarchy.temporaryVariables
- Temporary variables.- Throws:
java.lang.IllegalArgumentException
- if any of the parameters equalsnull
.
-
-
Method Detail
-
getRootPrimitive
public IsaPrimitive getRootPrimitive()
Returns the root of the primitive tree that describes the instruction.- Returns:
- Root of the primitive tree that describes the instruction.
-
execute
public void execute(ProcessingElement processingElement)
Runs simulation of a corresponding instruction described within the model.- Parameters:
processingElement
- Processing element instance.
-
getText
public java.lang.String getText()
Return the assembly code for the specified call (for example, the addition instruction of a MIPS processor: addu $1, $1, $2).- Returns:
- Text for the instruction call (assembler code).
-
getImage
public java.lang.String getImage()
Returns image (binary representation) of the instruction call.- Returns:
- Image (binary representation) of the instruction call.
-
getByteSize
public int getByteSize()
Returns the size of the instruction in bytes.- Returns:
- Size of the instruction in bytes.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-