-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefinitions.h
44 lines (35 loc) · 1.41 KB
/
definitions.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 __DEF_H__
#define __DEF_H__
//----------------------------------------------------------------
//----------------------------------------------------------------
/* ALL ENUMERATORS HERE */
// LOOP - Workload type for Loop
// RANDOM - Workload type for RANDOM
// LOCAL - 80-20 workload type
typedef enum enum_workloads{LOOP, RANDOM, LOCAL}WorkloadsT;
//----------------------------------------------------------------
//----------------------------------------------------------------
/* ALL STRUCTS HERE */
struct workload
{
// Defines type of workload
WorkloadsT type;
// The number of pages in workload
int pages;
// The total size of the workload
int size;
// The final work to run the policy
int * work;
};
//----------------------------------------------------------------
//----------------------------------------------------------------
/* ALL FUNCTION DEFINITIONS HERE */
struct workload * generate_workload(WorkloadsT type, int pages, int size);
struct workload * generate_random(struct workload * w);
struct workload * generate_loop(struct workload * w);
struct workload * generate_local(struct workload * w);
float policy_FIFO(struct workload * w, int cache_size);
float policy_LRU(struct workload * w, int cache_size);
float policy_RANDOM(struct workload * w, int cache_size);
float policy_LRUapprox(struct workload * w, int cache_size);
#endif /* __DEF_H__ */