changeset 66b3ed9a176e in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=66b3ed9a176e
description:
ruby: replace Time with Tick in replacement policy classes
diffstat:
src/mem/ruby/system/AbstractReplacementPolicy.hh | 14 +++++++-------
src/mem/ruby/system/LRUPolicy.hh | 6 +++---
src/mem/ruby/system/PseudoLRUPolicy.hh | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diffs (106 lines):
diff -r 5c6de9a7f8d8 -r 66b3ed9a176e
src/mem/ruby/system/AbstractReplacementPolicy.hh
--- a/src/mem/ruby/system/AbstractReplacementPolicy.hh Sun Feb 10 21:43:07
2013 -0600
+++ b/src/mem/ruby/system/AbstractReplacementPolicy.hh Sun Feb 10 21:43:08
2013 -0600
@@ -29,7 +29,7 @@
#ifndef __MEM_RUBY_SYSTEM_ABSTRACTREPLACEMENTPOLICY_HH__
#define __MEM_RUBY_SYSTEM_ABSTRACTREPLACEMENTPOLICY_HH__
-#include "mem/ruby/common/TypeDefines.hh"
+#include "base/types.hh"
class AbstractReplacementPolicy
{
@@ -38,18 +38,18 @@
virtual ~AbstractReplacementPolicy();
/* touch a block. a.k.a. update timestamp */
- virtual void touch(Index set, Index way, Time time) = 0;
+ virtual void touch(Index set, Index way, Tick time) = 0;
/* returns the way to replace */
virtual Index getVictim(Index set) const = 0;
/* get the time of the last access */
- Time getLastAccess(Index set, Index way);
+ Tick getLastAccess(Index set, Index way);
protected:
unsigned m_num_sets; /** total number of sets */
unsigned m_assoc; /** set associativity */
- Time **m_last_ref_ptr; /** timestamp of last reference */
+ Tick **m_last_ref_ptr; /** timestamp of last reference */
};
inline
@@ -58,9 +58,9 @@
{
m_num_sets = num_sets;
m_assoc = assoc;
- m_last_ref_ptr = new Time*[m_num_sets];
+ m_last_ref_ptr = new Tick*[m_num_sets];
for(unsigned i = 0; i < m_num_sets; i++){
- m_last_ref_ptr[i] = new Time[m_assoc];
+ m_last_ref_ptr[i] = new Tick[m_assoc];
for(unsigned j = 0; j < m_assoc; j++){
m_last_ref_ptr[i][j] = 0;
}
@@ -80,7 +80,7 @@
}
}
-inline Time
+inline Tick
AbstractReplacementPolicy::getLastAccess(Index set, Index way)
{
return m_last_ref_ptr[set][way];
diff -r 5c6de9a7f8d8 -r 66b3ed9a176e src/mem/ruby/system/LRUPolicy.hh
--- a/src/mem/ruby/system/LRUPolicy.hh Sun Feb 10 21:43:07 2013 -0600
+++ b/src/mem/ruby/system/LRUPolicy.hh Sun Feb 10 21:43:08 2013 -0600
@@ -39,7 +39,7 @@
LRUPolicy(Index num_sets, Index assoc);
~LRUPolicy();
- void touch(Index set, Index way, Time time);
+ void touch(Index set, Index way, Tick time);
Index getVictim(Index set) const;
};
@@ -55,7 +55,7 @@
}
inline void
-LRUPolicy::touch(Index set, Index index, Time time)
+LRUPolicy::touch(Index set, Index index, Tick time)
{
assert(index >= 0 && index < m_assoc);
assert(set >= 0 && set < m_num_sets);
@@ -67,7 +67,7 @@
LRUPolicy::getVictim(Index set) const
{
// assert(m_assoc != 0);
- Time time, smallest_time;
+ Tick time, smallest_time;
Index smallest_index;
smallest_index = 0;
diff -r 5c6de9a7f8d8 -r 66b3ed9a176e src/mem/ruby/system/PseudoLRUPolicy.hh
--- a/src/mem/ruby/system/PseudoLRUPolicy.hh Sun Feb 10 21:43:07 2013 -0600
+++ b/src/mem/ruby/system/PseudoLRUPolicy.hh Sun Feb 10 21:43:08 2013 -0600
@@ -50,7 +50,7 @@
PseudoLRUPolicy(Index num_sets, Index assoc);
~PseudoLRUPolicy();
- void touch(Index set, Index way, Time time);
+ void touch(Index set, Index way, Tick time);
Index getVictim(Index set) const;
private:
@@ -96,7 +96,7 @@
}
inline void
-PseudoLRUPolicy::touch(Index set, Index index, Time time)
+PseudoLRUPolicy::touch(Index set, Index index, Tick time)
{
assert(index >= 0 && index < m_assoc);
assert(set >= 0 && set < m_num_sets);
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev