edu.uci.eecs.doc.clepsydra
Class Clepsydra

java.lang.Object
  extended by edu.uci.eecs.doc.clepsydra.Clepsydra

public class Clepsydra
extends Object

This is the main class for the Clepsydra tool. It contains an entry point (main) for command-line execution, as well as helper methods for performing the timing analysis.

Author:
Trevor Harmon

Constructor Summary
Clepsydra(List<String> classPath)
          Creates a new Clepsydra object.
Clepsydra(String classPath)
          Creates a new Clepsydra object.
 
Method Summary
 Map<Integer,Integer> getBackAnnotations(Method method, String sourceCode, InstructionTimingStrategy instructionTimings, LoopBoundStrategy loopBounds, MethodCacheStrategy methodCache)
          Returns a mapping between source code and WCET timings.
 List<String> getClassPath()
          Returns the class path that was specified when the Clepsydra object was created.
 int getWCET(Method method, AnalysisStrategy strategy)
          Computes an upper bound on the WCET of the given method using the specifed analysis strategy.
 int getWCET(Tree tree, Graph graph, AnalysisStrategy strategy)
          Computes an upper bound on the WCET of a method using the specifed analysis strategy.
static void main(String[] args)
          An entry point for invoking Clepsydra from the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clepsydra

public Clepsydra(List<String> classPath)
Creates a new Clepsydra object.

Parameters:
classPath - a list of directories that will be searched when loading classes during control flow construction

Clepsydra

public Clepsydra(String classPath)
Creates a new Clepsydra object.

Parameters:
classPath - a list of directories, separated by the system's path separator character, that will be searched when loading classes during control flow construction
Method Detail

main

public static void main(String[] args)
An entry point for invoking Clepsydra from the command line. See the Clepsydra user manual for a description of command line arguments.

Parameters:
args - a list of command line arguments

getClassPath

public List<String> getClassPath()
Returns the class path that was specified when the Clepsydra object was created.

Returns:
the list of directories that will be searched when loading classes during control flow construction

getWCET

public int getWCET(Method method,
                   AnalysisStrategy strategy)
            throws IOException,
                   NoSuchMethodException,
                   ClassNotFoundException,
                   UnknownTimingException,
                   UnknownLoopBoundException
Computes an upper bound on the WCET of the given method using the specifed analysis strategy.

Parameters:
method - the method whose WCET is to be computed
strategy - the strategy to use when performing the computation
Returns:
the WCET in CPU cycles
Throws:
IOException - if the method cannot be loaded
NoSuchMethodException - if the method cannot be found
ClassNotFoundException - if the method's class cannot be found
UnknownTimingException - if the method contains an instruction whose timing is unknown
UnknownLoopBoundException - if the method contains a loop whose upper bound cannot be determined

getWCET

public int getWCET(Tree tree,
                   Graph graph,
                   AnalysisStrategy strategy)
            throws UnknownTimingException,
                   UnknownLoopBoundException
Computes an upper bound on the WCET of a method using the specifed analysis strategy. The control flow tree and control flow graph of the method must be specified. Both must be provided because some analysis strategies require the tree while others require the graph. If these data structures have already been constructed, then this method should be used instead of getWCET(Method, AnalysisStrategy) for performance reasons. (Otherwise, the method will be reloaded and its control flow tree and graph will be reconstructed.)

Parameters:
tree - the control flow tree of the method
graph - the control flow graph of the method
strategy - the strategy to use when performing the computation
Returns:
the WCET in CPU cycles
Throws:
UnknownTimingException - if the method contains an instruction whose timing is unknown
UnknownLoopBoundException - if the method contains a loop whose upper bound cannot be determined
See Also:
getWCET(Method, AnalysisStrategy)

getBackAnnotations

public Map<Integer,Integer> getBackAnnotations(Method method,
                                               String sourceCode,
                                               InstructionTimingStrategy instructionTimings,
                                               LoopBoundStrategy loopBounds,
                                               MethodCacheStrategy methodCache)
                                        throws IOException,
                                               NoSuchMethodException,
                                               ClassNotFoundException,
                                               UnknownTimingException,
                                               UnknownLoopBoundException,
                                               UnknownLineNumberException
Returns a mapping between source code and WCET timings. The TreeAnalysisStrategy is used to compute these timings.

Parameters:
method - the method whose WCET mapping is to be computed
sourceCode - the source code in which the method was declared; must be legal code (free of any compiler errors)
instructionTimings - a model of the temporal properties of the target CPU
loopBounds - a strategy for computing the upper bound on loops
methodCache - a strategy for modeling the method cache
Returns:
a map whose keys are source code line numbers and whose values are WCET timings, in cycles
Throws:
IOException - if the method cannot be loaded
NoSuchMethodException - if the method cannot be found
ClassNotFoundException - if the method's class cannot be found
UnknownTimingException - if the method contains an instruction whose timing is unknown
UnknownLoopBoundException - if the method contains a loop whose upper bound cannot be determined
UnknownLineNumberException
See Also:
TreeAnalysisStrategy