summaryrefslogtreecommitdiff
path: root/src/mem/SConscript
diff options
context:
space:
mode:
authorKanishk Sugand <kanishk.sugand@arm.com>2014-12-23 09:31:18 -0500
committerKanishk Sugand <kanishk.sugand@arm.com>2014-12-23 09:31:18 -0500
commit888975b29d920df9acdcf55db491d802e607cea6 (patch)
tree515af4570018def165c85e4e7d4c1744b77b3de6 /src/mem/SConscript
parent177682ead4e277cd25bcb92f7bdd9a37ada9c9cd (diff)
downloadgem5-888975b29d920df9acdcf55db491d802e607cea6.tar.xz
mem: Add a stack distance calculator
This patch adds a stand-alone stack distance calculator. The stack distance calculator is a passive SimObject that observes the addresses passed to it. It calculates stack distances (LRU Distances) of incoming addresses based on the partial sum hierarchy tree algorithm described by Alamasi et al. http://doi.acm.org/10.1145/773039.773043. For each transaction a hashtable look-up is performed. At every non-unique transaction the tree is traversed from the leaf at the returned index to the root, the old node is deleted from the tree, and the sums (to the right) are collected and decremented. The collected sum represets the stack distance of the found node. At every unique transaction the stack distance is returned as numeric_limits<uint64>::max(). In addition to the basic stack distance calculation, a feature to mark an old node in the tree is added. This is useful if it is required to see the reuse pattern. For example, Writebacks to the lower level (e.g. membus from L2), can be marked instead of being removed from the stack (isMarked flag of Node set to True). And then later if this same address is accessed (by L1), the value of the isMarked flag would be True. This gives some insight on how the Writeback policy of the lower level affect the read/write accesses in an application. Debugging is enabled by setting the verify flag to true. Debugging is implemented using a dummy stack that behaves in a naive way, using STL vectors. Note that this has a large impact on run time.
Diffstat (limited to 'src/mem/SConscript')
-rw-r--r--src/mem/SConscript4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mem/SConscript b/src/mem/SConscript
index e6973b1ac..50f58add1 100644
--- a/src/mem/SConscript
+++ b/src/mem/SConscript
@@ -44,6 +44,7 @@ SimObject('ExternalMaster.py')
SimObject('ExternalSlave.py')
SimObject('MemObject.py')
SimObject('SimpleMemory.py')
+SimObject('StackDistCalc.py')
SimObject('XBar.py')
Source('abstract_mem.cc')
@@ -64,6 +65,7 @@ Source('port_proxy.cc')
Source('physical.cc')
Source('simple_mem.cc')
Source('snoop_filter.cc')
+Source('stack_dist_calc.cc')
Source('tport.cc')
Source('xbar.cc')
@@ -101,7 +103,7 @@ DebugFlag('LLSC')
DebugFlag('MMU')
DebugFlag('MemoryAccess')
DebugFlag('PacketQueue')
-
+DebugFlag('StackDist')
DebugFlag("DRAMSim2")
DebugFlag("MemChecker")