diff options
author | Korey Sewell <ksewell@umich.edu> | 2010-03-23 00:29:10 -0400 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2010-03-23 00:29:10 -0400 |
commit | d484e1b334c6fd3f2721a2a4628c2324ed14fd08 (patch) | |
tree | c95594df5ecae29b11262967f3f8b99fca82ca5d /src/mem/ruby/system/AbstractReplacementPolicy.hh | |
parent | 70308bc835035b940efb36d7f335643dfaa39851 (diff) | |
parent | a0651b8f6127c8b7994a165b525e93d87c470d20 (diff) | |
download | gem5-d484e1b334c6fd3f2721a2a4628c2324ed14fd08.tar.xz |
m5merge(2): another merge of regression stats
Diffstat (limited to 'src/mem/ruby/system/AbstractReplacementPolicy.hh')
-rw-r--r-- | src/mem/ruby/system/AbstractReplacementPolicy.hh | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/mem/ruby/system/AbstractReplacementPolicy.hh b/src/mem/ruby/system/AbstractReplacementPolicy.hh index f06b8b8ee..3ddf4ab60 100644 --- a/src/mem/ruby/system/AbstractReplacementPolicy.hh +++ b/src/mem/ruby/system/AbstractReplacementPolicy.hh @@ -26,64 +26,64 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ABSTRACTREPLACEMENTPOLICY_H -#define ABSTRACTREPLACEMENTPOLICY_H +#ifndef __MEM_RUBY_SYSTEM_ABSTRACTREPLACEMENTPOLICY_HH__ +#define __MEM_RUBY_SYSTEM_ABSTRACTREPLACEMENTPOLICY_HH__ #include "mem/ruby/common/Global.hh" -class AbstractReplacementPolicy { - -public: - - AbstractReplacementPolicy(Index num_sets, Index assoc); - virtual ~AbstractReplacementPolicy(); +class AbstractReplacementPolicy +{ + public: + AbstractReplacementPolicy(Index num_sets, Index assoc); + virtual ~AbstractReplacementPolicy(); - /* touch a block. a.k.a. update timestamp */ - virtual void touch(Index set, Index way, Time time) = 0; + /* touch a block. a.k.a. update timestamp */ + virtual void touch(Index set, Index way, Time time) = 0; - /* returns the way to replace */ - virtual Index getVictim(Index set) const = 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); + /* get the time of the last access */ + Time getLastAccess(Index set, Index way); - protected: - unsigned int m_num_sets; /** total number of sets */ - unsigned int m_assoc; /** set associativity */ - Time **m_last_ref_ptr; /** timestamp of last reference */ + protected: + unsigned m_num_sets; /** total number of sets */ + unsigned m_assoc; /** set associativity */ + Time **m_last_ref_ptr; /** timestamp of last reference */ }; inline -AbstractReplacementPolicy::AbstractReplacementPolicy(Index num_sets, Index assoc) +AbstractReplacementPolicy::AbstractReplacementPolicy(Index num_sets, + Index assoc) { - m_num_sets = num_sets; - m_assoc = assoc; - m_last_ref_ptr = new Time*[m_num_sets]; - for(unsigned int i = 0; i < m_num_sets; i++){ - m_last_ref_ptr[i] = new Time[m_assoc]; - for(unsigned int j = 0; j < m_assoc; j++){ - m_last_ref_ptr[i][j] = 0; + m_num_sets = num_sets; + m_assoc = assoc; + m_last_ref_ptr = new Time*[m_num_sets]; + for(unsigned i = 0; i < m_num_sets; i++){ + m_last_ref_ptr[i] = new Time[m_assoc]; + for(unsigned j = 0; j < m_assoc; j++){ + m_last_ref_ptr[i][j] = 0; + } } - } } inline AbstractReplacementPolicy::~AbstractReplacementPolicy() { - if(m_last_ref_ptr != NULL){ - for(unsigned int i = 0; i < m_num_sets; i++){ - if(m_last_ref_ptr[i] != NULL){ - delete[] m_last_ref_ptr[i]; - } + if (m_last_ref_ptr != NULL){ + for (unsigned i = 0; i < m_num_sets; i++){ + if (m_last_ref_ptr[i] != NULL){ + delete[] m_last_ref_ptr[i]; + } + } + delete[] m_last_ref_ptr; } - delete[] m_last_ref_ptr; - } } -inline -Time AbstractReplacementPolicy::getLastAccess(Index set, Index way) +inline Time +AbstractReplacementPolicy::getLastAccess(Index set, Index way) { - return m_last_ref_ptr[set][way]; + return m_last_ref_ptr[set][way]; } -#endif // ABSTRACTREPLACEMENTPOLICY_H +#endif // __MEM_RUBY_SYSTEM_ABSTRACTREPLACEMENTPOLICY_HH__ |