summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/SparseMemory.hh
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2012-01-11 13:29:54 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2012-01-11 13:29:54 -0600
commit8b3ad17cc3189ed7470c82e9108669fe48541f43 (patch)
treef948368c4f528209f2ca81e0fc4e4b1de03740b2 /src/mem/ruby/system/SparseMemory.hh
parentc3109f77757b08f74768d44983ff81d7d66819e7 (diff)
downloadgem5-8b3ad17cc3189ed7470c82e9108669fe48541f43.tar.xz
Ruby Sparse Memory: Add function for collating blocks
This patch adds function to the Sparse Memory so that the blocks can be recorded in a cache trace. The blocks are added to the cache recorder which can later write them into a file.
Diffstat (limited to 'src/mem/ruby/system/SparseMemory.hh')
-rw-r--r--src/mem/ruby/system/SparseMemory.hh13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mem/ruby/system/SparseMemory.hh b/src/mem/ruby/system/SparseMemory.hh
index f4cc12f97..e4237dbcd 100644
--- a/src/mem/ruby/system/SparseMemory.hh
+++ b/src/mem/ruby/system/SparseMemory.hh
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2009 Advanced Micro Devices, Inc.
+ * Copyright (c) 2012 Mark D. Hill and David A. Wood
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,9 +33,9 @@
#include <iostream>
#include "base/hashmap.hh"
-#include "mem/ruby/slicc_interface/AbstractEntry.hh"
#include "mem/ruby/common/Address.hh"
-#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/recorder/CacheRecorder.hh"
+#include "mem/ruby/slicc_interface/AbstractEntry.hh"
typedef void* SparseMemEntry;
typedef m5::hash_map<Address, SparseMemEntry> SparseMapType;
@@ -59,6 +60,14 @@ class SparseMemory
void add(const Address& address, AbstractEntry*);
void remove(const Address& address);
+ /*!
+ * Function for recording the contents of memory. This function walks
+ * through all the levels of the sparse memory in a breadth first
+ * fashion. This might need more memory than a depth first approach.
+ * But breadth first seems easier to me than a depth first approach.
+ */
+ void recordBlocks(int cntrl_id, CacheRecorder *) const;
+
AbstractEntry* lookup(const Address& address);
// Print cache contents