-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp_cache.h
More file actions
74 lines (53 loc) · 1.49 KB
/
p_cache.h
File metadata and controls
74 lines (53 loc) · 1.49 KB
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
65
66
67
68
69
70
71
72
73
74
/*
* p_cache.h
*
* Created on: Nov 18, 2017
* Author: deep
*/
#ifndef P_CACHE_H_
#define P_CACHE_H_
#pragma once
//#include <stdint.h>
/*Default cache parameters- gets changed once the new parameters are input
#define DATA_CACHE_SIZE (1024 * 8)
#define ASSOCIATIVITY 1
#define BLOCK_SIZE
#define WRITE_POLICY
#define VICTIM_CACHE_SIZE*/
typedef struct block{
int val_bit;
int blk_index;
int tag;
};
typedef struct Cache_line_t{
//int tag;
int index;
int dirty_bit;
block *blk;
};
typedef struct cache{
Cache_line_t *sets;
};
//
/*************************************************/
/*Global Variable intitializations*/
/*************************************************/
static int L1_reads;
static int L1_read_misses;
static int VC_reads;
static int VC_read_misses;
static int L1_writes;
static int L1_write_misses;
static int VC_writes;
static int VC_write_misses;
static int main_Memory_To_Traffic;
static int main_Memory_From_Traffic;
/************************************************/
/***Function initializations ********************/
/*************************************************/
void cache_init(int no_sets, int associativity, int bloc_size, int no_of_blks, int size_vc, int wp);
int cache_invoke(cache*, int, int, int, int, char, unsigned long long int *, int, int wp);
int victimcache_search(unsigned long long int*, int tag_c, int);
void victimcache_replace(unsigned long long int*, int,int);
/************************************************/
#endif /* P_CACHE_H_ */