edu.uci.eecs.doc.clepsydra.timing
Interface InstructionTimingStrategy

All Known Implementing Classes:
JOPInstructionTimingStrategy

public interface InstructionTimingStrategy

A common interface for modeling the timing behavior of a microprocessor. By abstracting the temporal model behind this interface, Clepsydra can work with a variety of processors without knowing their architectural details.

Author:
Trevor Harmon

Method Summary
 int getCycles(Instruction instruction)
          Returns the number of cycles required to execute the given Java bytecode instruction.
 int getCycles(InvokeInstruction instruction)
          Returns the number of cycles required to execute the given invocation instruction.
 int getCycles(InvokeInstruction instruction, boolean cacheHit, int methodSize)
          Returns the number of cycles required to execute the given invocation instruction.
 int getCycles(ReturnInstruction instruction, boolean cacheHit, int methodSize)
          Returns the number of cycles required to execute the given return instruction.
 

Method Detail

getCycles

int getCycles(Instruction instruction)
              throws UnknownTimingException
Returns the number of cycles required to execute the given Java bytecode instruction.

Parameters:
instruction - a bytecode instruction whose cycle count is to be determined. Must not be of type ReturnInstruction nor InvokeInstruction.
Returns:
the number of cycles required to execute the instruction.
Throws:
UnknownTimingException - if the opcode is invalid or its cycle count is unknown

getCycles

int getCycles(InvokeInstruction instruction,
              boolean cacheHit,
              int methodSize)
              throws UnknownTimingException
Returns the number of cycles required to execute the given invocation instruction.

Parameters:
instruction - an invocation instruction whose cycle count is to be determined.
cacheHit - true if the method being invoked is guaranteed to be in the method cache; false otherwise
methodSize - the size, in bytes, of the method that the instruction invokes
Returns:
the number of cycles required to execute the instruction.
Throws:
UnknownTimingException - if the opcode is invalid or its cycle count is unknown

getCycles

int getCycles(InvokeInstruction instruction)
              throws UnknownTimingException
Returns the number of cycles required to execute the given invocation instruction. It assumes that the method to be invoked is already in the method cache and that its invocation will result in a cache hit.

Parameters:
instruction - an invocation instruction whose cycle count is to be determined.
Returns:
the number of cycles required to execute the instruction.
Throws:
UnknownTimingException - if the opcode is invalid or its cycle count is unknown

getCycles

int getCycles(ReturnInstruction instruction,
              boolean cacheHit,
              int methodSize)
              throws UnknownTimingException
Returns the number of cycles required to execute the given return instruction.

Parameters:
instruction - a return instruction whose cycle count is to be determined.
cacheHit - true if the method being returned to is guaranteed to be in the method cache; false otherwise
methodSize - the size, in bytes, of the method that is being returned to
Returns:
the number of cycles required to execute the instruction.
Throws:
UnknownTimingException - if the opcode is invalid or its cycle count is unknown