-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcacheSim.h
More file actions
32 lines (29 loc) · 723 Bytes
/
cacheSim.h
File metadata and controls
32 lines (29 loc) · 723 Bytes
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
#include "set.h"
#include <fstream>
#include <iostream>
#include <vector>
#include <deque> //pop_front and push_back for regular FIFO use
using namespace std;
class cacheSim
{
private:
unsigned int numSets;
unsigned int numBlocks;
unsigned int blockSize;
unsigned int setSize;
unsigned int setFieldSize;
unsigned int offsetSize;
unsigned int totalCount;
unsigned int hitCount;
vector<SetCache> sets; //collection of sets
public:
cacheSim();
cacheSim(unsigned int&, unsigned int&, unsigned int&);
string hex2B(string&);
unsigned int b2Dec(string);
void processAddress(char&, string&);
bool find(unsigned int&, string&);
void store(unsigned int&, string&);
float getHitRate();
int getTotalCount();
};