-
Notifications
You must be signed in to change notification settings - Fork 0
/
cachel1.h
64 lines (55 loc) · 1.3 KB
/
cachel1.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*******************************************************************
*
* DESCRIPTION: Atomic CacheL1
*
* AUTHOR: Yu Wang
*
* EMAIL: mailto://ambitionwang@gmail.com
*
* DATE: 15/10/2012
*
*******************************************************************/
#ifndef __CACHEL1_H
#define __CACHEL1_H
#include "atomic.h" // class Atomic
/** forward declarations **/
class Distribution ;
class CacheL1 : public Atomic
{
public:
CacheL1( const string &name = "CacheL1" ); //Default constructor
~CacheL1();
virtual string className() const ;
int indexEqualAddressIn(int AddressIn);
int replaceIndex();
protected:
Model &initFunction();
Model &externalFunction( const ExternalMessage & );
Model &internalFunction( const InternalMessage & );
Model &outputFunction( const InternalMessage & );
private:
const Port &AddressIn;
const Port &DataIn;
const Port &AddressOut;
const Port &DataOut;
const Port &ErrorOut;
int CacheAddress[4];
int CacheData[4];
int CacheCounter[4];
Time CacheAccessTime;
Time CacheTimingOutTime;
int data;
int address;
int hit;
int miss;
int index;
int ErrorFlag;
int AddressSent;
}; // class CacheL1
// ** inline ** //
inline
string CacheL1::className() const
{
return "CacheL1" ;
}
#endif //__CACHEL1_H