-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMvBuffer.h
47 lines (42 loc) · 1.04 KB
/
MvBuffer.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
/*
* @Author: Liu Xueyuan
* @Date: 2020-03-01 20:36:31
* @LastEditTime: 2020-05-10 09:30:18
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \sVPU-Sim\MvBuffer.h
*/
#ifndef _MVBUFFER_H_
#define _MVBUFFER_H_
#include <list>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>
#include "Buffer.h"
#include "GlobalVar.h"
#include "DramAddr.h"
using namespace std;
class MvBuffer: public Buffer<MvItem>{
private:
int curPage;
vector<MvItem> mvTable;
list<MvItem>::iterator procPtr, prefetchPtr;
int GetDramPage(MvItem item);
void GenerateLoadInstr();
MvReqGroup GenerateAlignedReq(MvItem item);
void FindNext();
void ResetPtr();
public:
queue<pair<uint64_t, DRAMSim::TransactionType> > instrQ;
MvBuffer():Buffer<MvItem>(5000, 4){ //32914
procPtr = content.begin();
prefetchPtr = content.begin();
curPage = 0;
}
void Init(vector<MvItem> allMvs);
int GetCurPage();
void MvBufferSim();
};
#endif