-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache.h
More file actions
38 lines (27 loc) · 704 Bytes
/
cache.h
File metadata and controls
38 lines (27 loc) · 704 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
//
// Created by Ignacio Mora on 2019-09-11.
//
#ifndef PROYECTO1ARQUIII_CACHE_H
#define PROYECTO1ARQUIII_CACHE_H
enum Status { INVALID, SHARED, MODIFIED };
typedef struct {
Status block_status;
int tag;
int data;
} CacheBlock;
class Cache {
private:
CacheBlock cacheBlocks[8] = {};
int num_core;
public:
Cache(int num_core);
int getTag(int block);
Status getStatus(int block);
int getData(int block);
void setTag(int block, int tag);
void setStatus(int block, Status status);
void setData(int block, int data);
void setBlock(int block, Status status, int tag, int data);
bool isCached(int address);
};
#endif //PROYECTO1ARQUIII_CACHE_H