Permalink
Browse files

Fixes memory cache numbers.

  • Loading branch information...
1 parent 40f74b0 commit 6c93ca31e33f061eede03997c8a48fd44fe9bbca Jeremy Aube committed Mar 30, 2012
Showing with 9 additions and 5 deletions.
  1. +8 −5 cache.cc
  2. +1 −0 cache.h
View
@@ -71,18 +71,20 @@ void Cache::Access(ulong addr, uchar op, vector<Cache*> &cachesArray) {
if (snoop) {
busUpd(addr, cachesArray);
newline->setFlags(SHARED_MODIFIED);
+ cacheToCacheTransfers++;
} else {
- newline->setFlags(MODIFIED);
+ newline->setFlags(MODIFIED);
+ memoryTransactions++;
}
writeMisses++;
} else {
snoop = busRd(addr, cachesArray);
if (snoop) {
newline->setFlags(SHARED_CLEAN);
- memoryTransactions++;
+ cacheToCacheTransfers++;
} else {
newline->setFlags(EXCLUSIVE);
- cacheToCacheTransfers++;
+ memoryTransactions++;
}
readMisses++;
}
@@ -150,9 +152,10 @@ bool Cache::busRd(ulong addr) {
return true;
} else if (line->getFlags() == MODIFIED || line->getFlags() == SHARED_MODIFIED) {
line->setFlags(SHARED_MODIFIED);
- memoryTransactions++;
return true;
- } else { // SHARED_CLEAN don't care
+ } else if (line->getFlags() == SHARED_CLEAN) {
+ return true;
+ } else {
return false;
}
}
View
@@ -134,6 +134,7 @@ class Cache {
void writeBack(ulong) {
writeBacks++;
+ memoryTransactions++;
}
void Access(ulong, uchar, std::vector<Cache*> &);

0 comments on commit 6c93ca3

Please sign in to comment.