As part of assignment in CS610A course in IIT Kanpur, this utility estimates cache misses for a program with perfect for
loop nests and simple indexing expressions. A number of simplifying assumptions are made, including existence of private cache for each multi-dimensional array and a single cache level.
It is assumed that ANTLR 4.8's JAR is located in $ANTLR_JAR
directory.
export CLASSPATH=".:$ANTLR_JAR:$CLASSPATH"
alias antlr4='java -Xmx500M -cp "$ANTLR_JAR" org.antlr.v4.Tool'
alias grun='java org.antlr.v4.gui.TestRig'
antlr4 LoopNest.g4
javac LoopNest*.java
javac Driver.java
java Driver <TestCase>
The output of testcase(s) is written to a serialized object, Results.obj
. To view the intermediate steps and the object (in human-readable form), pass a second argument with value true
, enabling debug mode.
Example:
java Driver testcases/TestCase1.t true
If ANTLR 4.8's JAR is located in base directory, run.sh
can be used to perform all steps from pre-compilation to execution.