# Node ID 003a85a6a6e3620cce5615e49a64e319752a5462 # Parent 76608773b16d1e73e2a96cebdebdd793a21fce69 diff --git a/src/mem/protocol/RubySlicc_Types.sm b/src/mem/protocol/RubySlicc_Types.sm --- a/src/mem/protocol/RubySlicc_Types.sm +++ b/src/mem/protocol/RubySlicc_Types.sm @@ -147,6 +147,7 @@ Address cacheProbe(Address); AbstractCacheEntry allocate(Address, AbstractCacheEntry); void allocateVoid(Address, AbstractCacheEntry); + AbstractCacheEntry allocateNoTouch(Address, AbstractCacheEntry); void deallocate(Address); AbstractCacheEntry lookup(Address); bool isTagPresent(Address); diff --git a/src/mem/ruby/structures/CacheMemory.hh b/src/mem/ruby/structures/CacheMemory.hh --- a/src/mem/ruby/structures/CacheMemory.hh +++ b/src/mem/ruby/structures/CacheMemory.hh @@ -74,7 +74,10 @@ bool cacheAvail(const Address& address) const; // find an unused entry and sets the tag appropriate for the address - AbstractCacheEntry* allocate(const Address& address, AbstractCacheEntry* new_entry); + AbstractCacheEntry* allocate(const Address& address, + AbstractCacheEntry* new_entry); + AbstractCacheEntry* allocateNoTouch(const Address& address, + AbstractCacheEntry* new_entry); void allocateVoid(const Address& address, AbstractCacheEntry* new_entry) { allocate(address, new_entry); diff --git a/src/mem/ruby/structures/CacheMemory.cc b/src/mem/ruby/structures/CacheMemory.cc --- a/src/mem/ruby/structures/CacheMemory.cc +++ b/src/mem/ruby/structures/CacheMemory.cc @@ -277,6 +277,34 @@ panic("Allocate didn't find an available entry"); } +AbstractCacheEntry* +CacheMemory::allocateNoTouch(const Address& address, AbstractCacheEntry* entry) +{ + assert(address == line_address(address)); + assert(!isTagPresent(address)); + assert(cacheAvail(address)); + DPRINTF(RubyCache, "address: %s\n", address); + + // Find the first open slot according to the replacement policy + int64 cacheSet = addressToCacheSet(address); + std::vector &set = m_cache[cacheSet]; + for (int i = 0; i < m_cache_assoc; i++) { + if (!set[i] || set[i]->m_Permission == AccessPermission_NotPresent) { + set[i] = entry; // Init entry + set[i]->m_Address = address; + set[i]->m_Permission = AccessPermission_Invalid; + DPRINTF(RubyCache, "Allocate clearing lock for addr: %x\n", + address); + set[i]->m_locked = -1; + m_tag_index[address] = i; + + return entry; + } + } + panic("Allocate didn't find an available entry"); +} + + void CacheMemory::deallocate(const Address& address) {