-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcache_block.cpp
41 lines (37 loc) · 899 Bytes
/
cache_block.cpp
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
/**
* @file cache_block.cpp
* @brief Implementation of the prototypes for the class which implements a basic cache memory block.
* @author Rafael Fao de Moura.
* @copyright GMICRO - UFSM - 2017.
*/
#include "cache_block.h"
cache_block::cache_block()
{
//this->current_MESI_state = INVALID;
this->valid_bit = 0;
this->tag = 0;
this->lru_counter = 0;
this->dirty_bit = 0;
this->tag_and_index = 0;
this->data = NULL;
}
cache_block::cache_block(uint8_t data_type,configuration* data)
{
//this->current_MESI_state = INVALID;
this->valid_bit = 0;
this->tag = 0;
this->lru_counter = 0;
this->dirty_bit = 0;
this->data_type = data_type;
this->data = data;
this->tag_and_index = 0;
}
cache_block::~cache_block()
{
if(this->data)
{
delete(this->data);
this->data = NULL;
}
return;
}