-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMemory_request_manager.h
42 lines (40 loc) · 1.32 KB
/
Memory_request_manager.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
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <deque>
#include <iomanip>
#include <set>
#include <queue>
#include "DRAM.h"
using namespace std;
class Memory_request_manager
{
public:
vector<map<int, string>> coreOpPrint;
vector<map<int, string>> registerPrint;
map<int, string> mrmPrint;
int totalBufferSize();
Memory_request_manager(int, int);
vector<deque<DRAM_ins>> mrmBuffer;
vector<deque<DRAM_ins>> justReceived;
int justReceivedSize = 0;
bool pointer_change_state;
string allot_new_instruction(int);
int bufferSize[1024] = {};
tuple<bool, int, string> checkForWriteback();
void updateMRM();
void increment_cycles();
void simulate_DRAM();
void sendToMRM(DRAM_ins, int);
bool forwardable(int);
void set(int, int);
int get_clock_cycles();
map<int, string> register_numbers; //maps each number in 0-31 to a register
vector<map<string, int>> register_values; //stores the value of data stored in each register
//each vector element stores register,values for a particular file
DRAM program_dram = DRAM(1, 2);
vector<map<string, int>> register_busy; //map each register to its lw/sw row number
map<int, string> forwarded_data; //string of (lw$t0.., core:1), (.....lw $t5, core:5..)
};