-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathlsqtest.cpp
89 lines (68 loc) · 2.29 KB
/
lsqtest.cpp
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
/*
ESESC: Super ESCalar simulator
Copyright (C) 2009 University of California, Santa Cruz.
Contributed by Jose Renau
Basilio Fraguela
Milos Prvulovic
Smruti Sarangi
This file is part of ESESC.
ESESC is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation;
either version 2, or (at your option) any later version.
ESESC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
ESESC; see the file COPYING. If not, write to the Free Software Foundation, 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
* This launches the ESESC simulator environment with an ideal memory
*/
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
#include "nanassert.h"
#include "DInst.h"
#include "Instruction.h"
//*********** BEGIN CREATE FAKE PROCESSOR CLASS
uint64_t nReplays = 0;
#define GPROCESSOR_H 1
class GProcessor {
public:
void replay(DInst *dinst) {
nReplays++;
}
};
//*********** END CREATE FAKE PROCESSOR CLASS
#include "LSQ.h"
#include "SescConf.h"
long long instTotal = 0;
LSQ *lsq;
void doTest() {
#if 0
Instruction *ld = Instruction::create(iLALU_LD, 0, 0, 0, 0, false );
Instruction *st = Instruction::create(iSALU_ST, 0, 0, 0, 0, false );
Instruction *stadd = Instruction::create(iSALU_ADDR, 0, 0, 0, 0, false );
DInst *dld1 = DInst::create(ld, rinst1, 0);
#endif
}
int main(int argc, const char **argv) {
SescConf = new SConfig(argc, argv);
GProcessor gproc;
// lsq = new LSQFull(&gproc,0);
lsq = new LSQFull(0);
I(0);
timeval startTime;
gettimeofday(&startTime, 0);
doTest();
timeval endTime;
gettimeofday(&endTime, 0);
double msecs = (endTime.tv_sec - startTime.tv_sec) * 1000 + (endTime.tv_usec - startTime.tv_usec) / 1000;
long double res = instTotal / 1000;
res /= msecs;
MSG("------------------");
MSG("LSQ MIPS = %g secs = %g insts = %lld", (double)res, msecs / 1000, (long long)instTotal);
MSG("------------------");
return 0;
}