-
Notifications
You must be signed in to change notification settings - Fork 0
/
FetchUnitManager.h
48 lines (41 loc) · 1.15 KB
/
FetchUnitManager.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
// Luke Mitchell, 2015
#ifndef __FETCHUNITMANAGER_H
#define __FETCHUNITMANAGER_H
#include <vector>
#include <string>
#include <queue>
#include "FetchUnit.h"
#include "MemoryLocation.h"
#include "DecodeUnitManager.h"
#include "BranchPredictionTable.h"
#include "BranchHistoryTable.h"
class FetchUnitManager {
private:
bool debug;
bool branchPrediction;
bool dynamicBranchPrediction;
bool speculative;
DecodeUnitManager* dum;
std::vector<FetchUnit> fus;
int lastIssued;
std::queue<int> waiting;
public:
Register pc;
FetchUnitManager(unsigned int width, DecodeUnitManager* dum);
void setDebug(bool debug);
bool getDebug();
void setBranchPrediction(bool branchPrediction);
bool getBranchPrediction();
void setDynamicBranchPrediction(bool dynamicBranchPrediction);
bool getDynamicBranchPrediction();
void setSpeculative(bool speculative);
bool getSpeculative();
std::string toString();
FetchUnit* getAvailableFetchUnit();
void tick(std::vector<MemoryLocation>* m, bool pipeline,
BranchPredictionTable* bpt, BranchHistoryTable* bht);
void clearPipeline(uint32_t pc);
unsigned int getNumberOfBranches();
};
#endif