-
Notifications
You must be signed in to change notification settings - Fork 1
/
MemoryOptions.h
44 lines (34 loc) · 1.28 KB
/
MemoryOptions.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
#ifndef MEM_OPTIONS_H
#define MEM_OPTIONS_H
///<summary>
/// A struct for configuring MemoryController and its components
///</summary>
struct MemoryOptions
{
// DTLB Options
int tlbEntries = 2; // # of TLB entries
// PT Options
int pageCount = 64; // # of virtual pages
int frameCount = 4; // # of physical frames
int pageSize = 256; // size of offsets
int vpnBits = 6; // # bits for vpn
int pfnBits = 2; // # bits for pfn
int offBits = 8; // # bits for page offset
// DC Options
int dcEntries = 4; // # of cache entries
int dcTotalSets = 0; // size of cache sets
int dcLineSize = 16; // size of cache lines
int dcPolicy = 1; // 0: write-through no write allocate, 1: write-back, write-allocate
int dcSetSize = 1; // set size from config file
int cacheTagBits = 0; // number of tag index bits
int cacheIndexBits = 0; // number of cache index bits
int cacheOffsetBits = 5; // number of offset bits
int cacheEntriesPerSet = 0;
// Other
bool useVirt =true; // true: use virtual addressing
bool useTLB =true; // true: use TLB (requires useVirt == true)
// Default constructor
MemoryOptions() {
}
};
#endif //MEM_OPTIONS_H