summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/PersistentTable.hh
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2009-11-18 16:34:33 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2009-11-18 16:34:33 -0800
commit5d8a669539a142ece820cf0c82722ea1c755d7cd (patch)
treeb17fb03643674b83785859378296ed4690e3d715 /src/mem/ruby/system/PersistentTable.hh
parentc6182199c54a874315a97338879d5bfaf3895a6f (diff)
downloadgem5-5d8a669539a142ece820cf0c82722ea1c755d7cd.tar.xz
Resurrection of the CMP token protocol to GEM5
Diffstat (limited to 'src/mem/ruby/system/PersistentTable.hh')
-rw-r--r--src/mem/ruby/system/PersistentTable.hh40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/mem/ruby/system/PersistentTable.hh b/src/mem/ruby/system/PersistentTable.hh
index ab000843d..8cbb48817 100644
--- a/src/mem/ruby/system/PersistentTable.hh
+++ b/src/mem/ruby/system/PersistentTable.hh
@@ -30,20 +30,26 @@
#ifndef PersistentTable_H
#define PersistentTable_H
-#include "Global.h"
-#include "MachineID.h"
-#include "AccessType.h"
+#include "mem/ruby/common/Global.hh"
+#include "mem/gems_common/Map.hh"
+#include "mem/ruby/common/Address.hh"
+#include "mem/ruby/system/MachineID.hh"
+#include "mem/protocol/AccessType.hh"
+#include "mem/ruby/common/NetDest.hh"
-class AbstractChip;
+class PersistentTableEntry {
+public:
+ void print(ostream& out) const {}
-template <class KEY_TYPE, class VALUE_TYPE> class Map;
-class Address;
-class PersistentTableEntry;
+ NetDest m_starving;
+ NetDest m_marked;
+ NetDest m_request_to_write;
+};
class PersistentTable {
public:
// Constructors
- PersistentTable(AbstractChip* chip_ptr, int version);
+ PersistentTable();
// Destructor
~PersistentTable();
@@ -51,7 +57,7 @@ public:
// Public Methods
void persistentRequestLock(const Address& address, MachineID locker, AccessType type);
void persistentRequestUnlock(const Address& address, MachineID unlocker);
- bool okToIssueStarving(const Address& address) const;
+ bool okToIssueStarving(const Address& address, MachineID machID) const;
MachineID findSmallest(const Address& address) const;
AccessType typeOfSmallest(const Address& address) const;
void markEntries(const Address& address);
@@ -71,17 +77,12 @@ private:
// Data Members (m_prefix)
Map<Address, PersistentTableEntry>* m_map_ptr;
- AbstractChip* m_chip_ptr;
- int m_version;
};
-// Output operator declaration
-ostream& operator<<(ostream& out, const PersistentTable& obj);
-
// ******************* Definitions *******************
// Output operator definition
-extern inline
+extern inline
ostream& operator<<(ostream& out, const PersistentTable& obj)
{
obj.print(out);
@@ -89,4 +90,13 @@ ostream& operator<<(ostream& out, const PersistentTable& obj)
return out;
}
+// Output operator definition
+extern inline
+ostream& operator<<(ostream& out, const PersistentTableEntry& obj)
+{
+ obj.print(out);
+ out << flush;
+ return out;
+}
+
#endif //PersistentTable_H