diff -r 514ddcac7c76 -r 4f568aac2370 src/mem/ruby/slicc_interface/AbstractCacheEntry.hh --- a/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh Sun Jul 19 18:39:40 2015 -0500 +++ b/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh Sun Jul 19 18:40:48 2015 -0500 @@ -62,9 +62,22 @@ void setLocked(int context) { m_locked = context; } void clearLocked() { m_locked = -1; } - Addr m_Address; // Address of this block, required by CacheMemory - int m_locked; // Holds info whether the address is locked, - // required for implementing LL/SC + void setSetIndex(uint32_t s) { setIndex = s; } + uint32_t getSetIndex() const { return setIndex; } + + void setWayIndex(uint32_t s) { wayIndex = s; } + uint32_t getWayIndex() const { return wayIndex; } + + // Address of this block, required by CacheMemory + Addr m_Address; + // Holds info whether the address is locked. + // Required for implementing LL/SC operations. + int m_locked; + + private: + // Set and way coordinates of the entry within the cache memory object. + uint32_t setIndex; + uint32_t wayIndex; }; inline std::ostream& diff -r 514ddcac7c76 -r 4f568aac2370 src/mem/ruby/structures/CacheMemory.hh --- a/src/mem/ruby/structures/CacheMemory.hh Sun Jul 19 18:39:40 2015 -0500 +++ b/src/mem/ruby/structures/CacheMemory.hh Sun Jul 19 18:40:48 2015 -0500 @@ -74,7 +74,7 @@ bool cacheAvail(Addr address) const; // find an unused entry and sets the tag appropriate for the address - AbstractCacheEntry* allocate(Addr address, AbstractCacheEntry* new_entry); + AbstractCacheEntry *allocate(Addr address, AbstractCacheEntry* new_entry); void allocateVoid(Addr address, AbstractCacheEntry* new_entry) { allocate(address, new_entry); diff -r 514ddcac7c76 -r 4f568aac2370 src/mem/ruby/structures/CacheMemory.cc --- a/src/mem/ruby/structures/CacheMemory.cc Sun Jul 19 18:39:40 2015 -0500 +++ b/src/mem/ruby/structures/CacheMemory.cc Sun Jul 19 18:40:48 2015 -0500 @@ -236,7 +236,7 @@ } AbstractCacheEntry* -CacheMemory::allocate(Addr address, AbstractCacheEntry* entry) +CacheMemory::allocate(Addr address, AbstractCacheEntry *entry) { assert(address == makeLineAddress(address)); assert(!isTagPresent(address)); @@ -257,6 +257,8 @@ m_tag_index[address] = i; m_replacementPolicy_ptr->touch(cacheSet, i, curTick()); + entry->setSetIndex(cacheSet); + entry->setWayIndex(i); return entry; }