summaryrefslogtreecommitdiff
path: root/src/mem/ruby/structures
diff options
context:
space:
mode:
authorJoel Hestness <jthestness@gmail.com>2015-08-14 00:19:39 -0500
committerJoel Hestness <jthestness@gmail.com>2015-08-14 00:19:39 -0500
commitbf06911b3f6d992dc78489d66410f4580a17db7b (patch)
tree74799214cc889c3531d263543af4d144d5a3bf9c /src/mem/ruby/structures
parent9567c839fecfdb29a59f9da50cf706fcb22a2bb1 (diff)
downloadgem5-bf06911b3f6d992dc78489d66410f4580a17db7b.tar.xz
ruby: Change PerfectCacheMemory::lookup to return pointer
CacheMemory and DirectoryMemory lookup functions return pointers to entries stored in the memory. Bring PerfectCacheMemory in line with this convention, and clean up SLICC code generation that was in place solely to handle references like that which was returned by PerfectCacheMemory::lookup.
Diffstat (limited to 'src/mem/ruby/structures')
-rw-r--r--src/mem/ruby/structures/PerfectCacheMemory.hh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mem/ruby/structures/PerfectCacheMemory.hh b/src/mem/ruby/structures/PerfectCacheMemory.hh
index 555f24b71..413a0f471 100644
--- a/src/mem/ruby/structures/PerfectCacheMemory.hh
+++ b/src/mem/ruby/structures/PerfectCacheMemory.hh
@@ -71,8 +71,8 @@ class PerfectCacheMemory
Address cacheProbe(const Address& newAddress) const;
// looks an address up in the cache
- ENTRY& lookup(const Address& address);
- const ENTRY& lookup(const Address& address) const;
+ ENTRY* lookup(const Address& address);
+ const ENTRY* lookup(const Address& address) const;
// Get/Set permission of cache block
AccessPermission getPermission(const Address& address) const;
@@ -151,18 +151,18 @@ PerfectCacheMemory<ENTRY>::cacheProbe(const Address& newAddress) const
// looks an address up in the cache
template<class ENTRY>
-inline ENTRY&
+inline ENTRY*
PerfectCacheMemory<ENTRY>::lookup(const Address& address)
{
- return m_map[line_address(address)].m_entry;
+ return &m_map[line_address(address)].m_entry;
}
// looks an address up in the cache
template<class ENTRY>
-inline const ENTRY&
+inline const ENTRY*
PerfectCacheMemory<ENTRY>::lookup(const Address& address) const
{
- return m_map[line_address(address)].m_entry;
+ return &m_map[line_address(address)].m_entry;
}
template<class ENTRY>