#include "block.h" using CacheSim::Block; Block::Block(short tagSize) { this->valid = false; this->tag.assign(tagSize, 0); this->tagSize = tagSize; this->recentlyAccess = 0; } bool Block::getValid(){ return this->valid; } vector Block::getTag(){ return this->tag; } void Block::update(vector tag){ this->valid = true; this->tag.clear(); this->tag.assign(tag.begin(), tag.end()); } void Block::countAccess(){ if(this->valid){ this->recentlyAccess++; } } void Block::access(){ this->recentlyAccess = 0; } short Block::getAccessTime(){ return this->recentlyAccess; }