Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int SharedCache::replaceLine(ullong address){
- int evictPID = -1;
- int cacheSet = calcCacheSet( address );
- //random uniformly-distributed value for cache line
- float numLines = static_cast<float>(CACHE_LINES_PER_SET);
- uint cacheLine = static_cast<uint>(uniformDistr( numLines ));
- if(cache[cacheSet][cacheLine] != NULL){
- evictPID = cache[cacheSet][cacheLine]->PID;
- }
- uint PID= calcPID(address);
- uint tag= calcTag(address);
- cache[cacheSet][cacheLine]->setLine(PID, tag); //mutex method
- return PID;
- }
- gcc -o my_program SharedCache.o -ldistributions
- gcc -o my_program SharedCache.o distributions.o
Add Comment
Please, Sign In to add comment