ruby: allocate a block in CacheMemory without updating LRU state
This commit is contained in:
parent
7e00772bda
commit
7e9562013b
3 changed files with 13 additions and 4 deletions
|
@ -146,6 +146,7 @@ structure (CacheMemory, external = "yes") {
|
|||
bool cacheAvail(Address);
|
||||
Address cacheProbe(Address);
|
||||
AbstractCacheEntry allocate(Address, AbstractCacheEntry);
|
||||
AbstractCacheEntry allocate(Address, AbstractCacheEntry, bool);
|
||||
void allocateVoid(Address, AbstractCacheEntry);
|
||||
void deallocate(Address);
|
||||
AbstractCacheEntry lookup(Address);
|
||||
|
|
|
@ -251,7 +251,7 @@ CacheMemory::cacheAvail(const Address& address) const
|
|||
}
|
||||
|
||||
AbstractCacheEntry*
|
||||
CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry)
|
||||
CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry, bool touch)
|
||||
{
|
||||
assert(address == line_address(address));
|
||||
assert(!isTagPresent(address));
|
||||
|
@ -271,7 +271,9 @@ CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry)
|
|||
set[i]->m_locked = -1;
|
||||
m_tag_index[address] = i;
|
||||
|
||||
m_replacementPolicy_ptr->touch(cacheSet, i, curTick());
|
||||
if (touch) {
|
||||
m_replacementPolicy_ptr->touch(cacheSet, i, curTick());
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
|
|
@ -74,10 +74,16 @@ class CacheMemory : public SimObject
|
|||
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, bool touch);
|
||||
AbstractCacheEntry* allocate(const Address& address,
|
||||
AbstractCacheEntry* new_entry)
|
||||
{
|
||||
return allocate(address, new_entry, true);
|
||||
}
|
||||
void allocateVoid(const Address& address, AbstractCacheEntry* new_entry)
|
||||
{
|
||||
allocate(address, new_entry);
|
||||
allocate(address, new_entry, true);
|
||||
}
|
||||
|
||||
// Explicitly free up this address
|
||||
|
|
Loading…
Reference in a new issue