-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestCase.java
More file actions
95 lines (84 loc) · 2.5 KB
/
Copy pathTestCase.java
File metadata and controls
95 lines (84 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import java.util.*;
import static java.util.stream.Collectors.*;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import org.antlr.v4.runtime.tree.ParseTreeProperty;
import org.antlr.v4.runtime.tree.TerminalNode;
public class TestCase {
long cacheSize;
long blockSize;
long numWays;
long numBlocks;
long numSets;
Analysis.CacheTypes CacheType;
String TestCaseName;
HashMap<String, ArrayInfo> Arrays;
HashMap<String, Long> SymbolTable;
HashMap<String, Analysis.Types> NonImpVars;
HashMap<String, Long> ComputedMisses;
ArrayList<ForLoop> Loops;
boolean currVarDeclaration;
boolean currVarIsArr;
int currVarArrDim;
Analysis.Types currVarType;
boolean isImpVar;
String currVarName;
int currVarDims;
long currVarDimSize[] = new long[3];
long currVarVal;
boolean forInit;
boolean forCond;
int forLoopDepth;
boolean beginCompute;
public TestCase(){
currVarDeclaration = false;
forLoopDepth = -1;
numSets = 0;
beginCompute = false;
cacheSize = 0;
blockSize = 0;
numWays = 0;
numBlocks = 0;
TestCaseName = new String("");
CacheType = Analysis.CacheTypes.SetAssociative;
Arrays = new HashMap<String, ArrayInfo>();
SymbolTable = new HashMap<String, Long>();
ComputedMisses = new HashMap<String, Long>();
Loops = new ArrayList<ForLoop>();
NonImpVars = new HashMap<String, Analysis.Types>();
}
public void currVarReset(){
currVarDeclaration = false;
currVarIsArr = false;
currVarArrDim = 0;
isImpVar = false;
currVarDimSize[0] = currVarDimSize[1] = currVarDimSize[2] = 0;
currVarType = Analysis.Types.Byte;
currVarIsArr = false;
currVarName = "";
currVarDims = 0;
currVarVal = 0;
}
public void CleanUp(){
currVarDeclaration = false;
forLoopDepth = -1;
numSets = 0;
beginCompute = false;
cacheSize = 0;
blockSize = 0;
numWays = 0;
numBlocks = 0;
CacheType = Analysis.CacheTypes.SetAssociative;
TestCaseName = "";
Arrays.clear();
SymbolTable.clear();
Loops.clear();
NonImpVars.clear();
ComputedMisses = new HashMap<String, Long>();
}
public long ResolveSymbolicAssignment(String alias){
return SymbolTable.get(alias);
}
}