-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCacheLine.h
More file actions
39 lines (35 loc) · 862 Bytes
/
Copy pathCacheLine.h
File metadata and controls
39 lines (35 loc) · 862 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
33
34
35
36
37
38
39
#ifndef CACHELINE_H_
#define CACHELINE_H_
#include <includes.h>
#define READ_ACCESS 'R'
#define WRITE_ACCESS 'W'
class CacheLine
{
private:
bool wb;
bool v;
bool M;
uint64_t tag;
uint64_t hits;
uint64_t misses;
uint64_t cache_reads;
uint64_t cache_writes;
uint64_t mem_reads;
uint64_t mem_writes;
void write_through();
void write_back();
void handle_miss (uint64_t p_tag);
public:
CacheLine (bool _wb=true);
bool valid();
uint64_t getTag();
uint64_t getHits();
uint64_t getMisses();
uint64_t getCacheReads();
uint64_t getCacheWrites();
uint64_t getMEMReads();
uint64_t getMEMWrites();
void access (uint64_t p_tag,char mode);
~CacheLine();
};
#endif // CACHELINE_H_