-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStats.h
51 lines (38 loc) · 976 Bytes
/
Stats.h
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
#ifndef __STATS_H
#define __STATS_H
#include <iostream>
#include <iomanip>
#include "Debug.h"
using namespace std;
enum PIPESTAGE { IF1 = 0, IF2 = 1, ID = 2, EXE1 = 3, EXE2 = 4, MEM1 = 5,
MEM2 = 6, WB = 7, PIPESTAGES = 8 };
class Stats {
private:
long long cycles;
int flushes;
int bubbles;
int memops;
int branches;
int taken;
int resultReg[PIPESTAGES];
public:
Stats();
void clock();
void flush(int count);
void registerSrc(int r);
void registerDest(int r);
void countMemOp() { memops++; }
void countBranch() { branches++; }
void countTaken() { taken++; }
void showPipe();
// getters
long long getCycles() { return cycles; }
int getFlushes() { return flushes; }
int getBubbles() { return bubbles; }
int getMemOps() { return memops; }
int getBranches() { return branches; }
int getTaken() { return taken; }
private:
void bubble();
};
#endif