Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 32 lines (22 sloc) 0.613 kb
fa2404c Made classes for Set and Block
SIddardha G authored
1 #ifndef SET_H_
2 #define SET_H_
3
5649cdc Finished implemeting Cache with Sets and Blocks
SIddardha G authored
4 #include "Block.h"
5
fa2404c Made classes for Set and Block
SIddardha G authored
6 class Set {
fa15031 @pksunkara Added memory get function to check cache
authored
7 public:
8 Set(int assoc, int block_size);
fa2404c Made classes for Set and Block
SIddardha G authored
9
fa15031 @pksunkara Added memory get function to check cache
authored
10 Block* get_block(int index);
4691547 @pksunkara Cold & Conflict misses done
authored
11 bool get_dirty(void);
12
fa15031 @pksunkara Added memory get function to check cache
authored
13 void insert_block(int tag_value, Block* new_block);
4691547 @pksunkara Cold & Conflict misses done
authored
14 int counter(void);
fa15031 @pksunkara Added memory get function to check cache
authored
15 void inc_counter(int index);
5649cdc Finished implemeting Cache with Sets and Blocks
SIddardha G authored
16
4691547 @pksunkara Cold & Conflict misses done
authored
17 void set_dirty(void);
18
fa15031 @pksunkara Added memory get function to check cache
authored
19 ~Set();
5649cdc Finished implemeting Cache with Sets and Blocks
SIddardha G authored
20
fa15031 @pksunkara Added memory get function to check cache
authored
21 private:
4691547 @pksunkara Cold & Conflict misses done
authored
22 Block** data; // Array of Blocks
23 bool* dirty; // Array of dirty bits
24
fa15031 @pksunkara Added memory get function to check cache
authored
25 int assoc; // Associativity
26 int block_size; // Size of each block
4691547 @pksunkara Cold & Conflict misses done
authored
27 int _counter; // Counter for giving unique index to each block
28 int lru; // Index of block having the least value of counter
fa2404c Made classes for Set and Block
SIddardha G authored
29 };
30
31 #endif /* SET_H_ */
Something went wrong with that request. Please try again.