-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCache.h
More file actions
55 lines (50 loc) · 1001 Bytes
/
Cache.h
File metadata and controls
55 lines (50 loc) · 1001 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _CACHE_H_
#define _CACHE_H_
#include <StorageObject.h>
#include <Bus.h>
#include <Memory.h>
#include <Counter.h>
#include <BusALU.h>
#include <Clock.h>
#include <iostream>
#include <stdio.h>
#include <cstdlib>
using namespace std;
struct cache_data{
long data;
long address;
int reg;
} typedef CACHE_DATA;
class Cache{
public:
Cache(int, bool);
~Cache();
void setupConnections( Counter, Memory, BusALU);
bool contains(long, bool);
void preFetch(bool, Memory);
int miss;
int hits;
Counter prefetchAddr;
void debugInfo(void);
bool retrieve(long, bool, Counter);
private:
bool prefetch;
Bus cacheBus;
StorageObject temp;
StorageObject i0;
StorageObject i1;
StorageObject i2;
StorageObject i3;
StorageObject i4;
StorageObject d0;
StorageObject d1;
StorageObject d2;
StorageObject d3;
StorageObject d4;
CACHE_DATA instructionArray[5];
CACHE_DATA dataArray[5];
void swap(long,long,bool);
long prefetchAddress;
int size;
};
#endif