-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpredictor.h
41 lines (27 loc) · 1012 Bytes
/
predictor.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
//Ye Wang
//CPEG652
//October 23,2015
#ifndef _PREDICTOR_H_
#define _PREDICTOR_H_
#include "utils.h"
#include "tracer.h"
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
class PREDICTOR{
// The state is defined for Gshare, change for your design
private:
UINT32 ghr; // global history register
UINT32 *pht[4]; // pattern history table
UINT32 historyLength[4]; // history length
UINT32 numPhtEntries[4]; // entries in pht
int state; //prediction result recorder
public:
// The interface to the four functions below CAN NOT be changed
PREDICTOR(void);
bool GetPrediction(UINT32 PC);
void UpdatePredictor(UINT32 PC, bool resolveDir, bool predDir, UINT32 branchTarget);
void TrackOtherInst(UINT32 PC, OpType opType, UINT32 branchTarget);
// Contestants can define their own functions below
};
/***********************************************************/
#endif