summaryrefslogtreecommitdiff
path: root/src/mem/cache/base.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@arm.com>2012-11-02 11:32:02 -0500
committerAndreas Sandberg <Andreas.Sandberg@arm.com>2012-11-02 11:32:02 -0500
commitddd6af414cdd4939f4ff382f0e83e7dfa695781d (patch)
tree5149831ec4714dea40a550665ba87e1299d4485a /src/mem/cache/base.cc
parent050f24c7964cbe65633261e431e1105d1d5e8070 (diff)
downloadgem5-ddd6af414cdd4939f4ff382f0e83e7dfa695781d.tar.xz
mem: Add support for writing back and flushing caches
This patch adds support for the following optional drain methods in the classical memory system's cache model: memWriteback() - Write back all dirty cache lines to memory using functional accesses. memInvalidate() - Invalidate all cache lines. Dirty cache lines are lost unless a writeback is requested. Since memWriteback() is called when checkpointing systems, this patch adds support for checkpointing systems with caches. The serialization code now checks whether there are any dirty lines in the cache. If there are dirty lines in the cache, the checkpoint is flagged as bad and a warning is printed.
Diffstat (limited to 'src/mem/cache/base.cc')
-rw-r--r--src/mem/cache/base.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index ad1c751bc..262573663 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -751,7 +751,8 @@ BaseCache::regStats()
unsigned int
BaseCache::drain(DrainManager *dm)
{
- int count = memSidePort->drain(dm) + cpuSidePort->drain(dm);
+ int count = memSidePort->drain(dm) + cpuSidePort->drain(dm) +
+ mshrQueue.drain(dm) + writeBuffer.drain(dm);
// Set status
if (count != 0) {