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/SparseMemory.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/SparseMemory.hh')
-rw-r--r-- | src/mem/ruby/system/SparseMemory.hh | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/src/mem/ruby/system/SparseMemory.hh b/src/mem/ruby/system/SparseMemory.hh index 4a7ac98c2..6e3c8f926 100644 --- a/src/mem/ruby/system/SparseMemory.hh +++ b/src/mem/ruby/system/SparseMemory.hh @@ -1,4 +1,3 @@ - /* * Copyright (c) 2009 Advanced Micro Devices, Inc. * All rights reserved. @@ -27,39 +26,35 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __MEM_RUBY_SYSTEM_SPARSEMEMORY_HH__ +#define __MEM_RUBY_SYSTEM_SPARSEMEMORY_HH__ -#ifndef SPARSEMEMORY_H -#define SPARSEMEMORY_H - -#include "mem/ruby/common/Global.hh" #include "base/hashmap.hh" -#include "mem/ruby/common/Address.hh" #include "mem/protocol/Directory_Entry.hh" +#include "mem/ruby/common/Address.hh" +#include "mem/ruby/common/Global.hh" -typedef struct SparseMemEntry { +struct SparseMemEntry +{ void* entry; -} SparseMemEntry_t; +}; -typedef m5::hash_map<Address, SparseMemEntry_t> SparseMapType; +typedef m5::hash_map<Address, SparseMemEntry> SparseMapType; -typedef struct curNextInfo { +struct CurNextInfo +{ SparseMapType* curTable; int level; int highBit; int lowBit; }; -class SparseMemory { +class SparseMemory +{ public: - - // Constructors SparseMemory(int number_of_bits, int number_of_levels); - - // Destructor ~SparseMemory(); - // Public Methods - void printConfig(ostream& out) { } bool exist(const Address& address) const; @@ -83,7 +78,7 @@ class SparseMemory { void recursivelyRemoveTables(SparseMapType* currentTable, int level); // recursive search for address and remove associated entries - int recursivelyRemoveLevels(const Address& address, curNextInfo& curInfo); + int recursivelyRemoveLevels(const Address& address, CurNextInfo& curInfo); // Data Members (m_prefix) SparseMapType* m_map_head; @@ -98,17 +93,12 @@ class SparseMemory { uint64_t* m_removes_per_level; }; -// Output operator declaration -ostream& operator<<(ostream& out, const SparseMemEntry& obj); - -// Output operator definition -extern inline -ostream& operator<<(ostream& out, const SparseMemEntry& obj) +inline ostream& +operator<<(ostream& out, const SparseMemEntry& obj) { out << "SparseMemEntry"; out << flush; return out; } - -#endif //SPARSEMEMORY_H +#endif // __MEM_RUBY_SYSTEM_SPARSEMEMORY_HH__ |