-
Notifications
You must be signed in to change notification settings - Fork 0
/
NotTaken.h
55 lines (42 loc) · 970 Bytes
/
NotTaken.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
52
53
54
55
/*
* NotTaken.h
*
* Branch Predictor Class: not-taken branch Predictor
* for Sniper Simulation
*
* < Chris Mark >
*
*/
#ifndef NOT_TAKEN_H
#define NOT_TAKEN_H
#include "branch_predictor.h"
#include <cstring>
#include <iostream>
class NotTakenPredictor : public BranchPredictor
{
public:
NotTakenPredictor(String name, core_id_t core_id)
: BranchPredictor(name, core_id)
{
};
~NotTakenPredictor()
{
};
/**
* Called from the Simulator to predict the result of branch instruction
* in address 'ip' and target 'target'.
**/
bool predict(IntPtr ip, IntPtr target)
{
unsigned long long prediction = 0;
return (prediction != 0);
};
/**
* Called from the Simulator to update the internal state of the predictor.
**/
void update(bool predicted, bool actual, IntPtr ip, IntPtr target)
{
updateCounters(predicted, actual);
};
};
#endif