#ifndef CCACHE_H #define CCACHE_H #include "block.h" #include "system.h" const int ASSOCIATIVITY = 2; class CCache { public: CCache::CCache(void); CCache::CCache(long int bsize, long int csizekb); CCache::InitializeCache(long int bsize, long int csizekb); int CCache::isCached(long int block, int penum); long int CCache::getCurrAddress(void); long int CCache::getCurrBlock(void); long int CCache::getCurrBIndex(void); int CCache::addBlock(CBlock addblock, int penum, long int currblock); void CCache::setCurrAddress(long int addr); CBlock* Blocks; private: long int BlockSize; long int CacheSize; long int CurrAddress; long int CurrBlock; long int CurrBIndex; long int NumBlocks; bool Full; }; #endif