src/mem/ruby/structures/CacheMemory.cc
//fanyao commented: not testing permissions
fanyao commented: not testing permissions
fanyao commented : not testing permissions
bool
CacheMemory::testCacheAccess(Addr address, RubyRequestType type,
                             DataBlock*& data_ptr)
{
    assert(address == makeLineAddress(address));
    DPRINTF(RubyCache, "address: %#x\n", address);
    int64_t cacheSet = addressToCacheSet(address);
    int loc = findTagInSet(cacheSet, address);
    if (loc != -1) {
        AbstractCacheEntry* entry = m_cache[cacheSet][loc];
        m_replacementPolicy_ptr->touch(cacheSet, loc, curTick());
        data_ptr = &(entry->getDataBlk());
        return m_cache[cacheSet][loc]->m_Permission !=
            AccessPermission_NotPresent;
    }
    data_ptr = NULL;
    return false;
}
bool CacheMemory :: testCacheAccess ( Addr address , RubyRequestType type , DataBlock * & data_ptr ) { assert ( address == makeLineAddress ( address ) ) ; DPRINTF ( RubyCache , " \n " , address ) ; int64_t cacheSet = addressToCacheSet ( address ) ; int loc = findTagInSet ( cacheSet , address ) ; if ( loc != -1 ) { AbstractCacheEntry * entry = m_cache [ cacheSet ] [ loc ] ; m_replacementPolicy_ptr -> touch ( cacheSet , loc , curTick ( ) ) ; data_ptr = & ( entry -> getDataBlk ( ) ) ; return m_cache [ cacheSet ] [ loc ] -> m_Permission != AccessPermission_NotPresent ; } data_ptr = NULL ; return false ; }
fanyao commented: not testing permissions
fanyao commented : not testing permissions
// Do we even have a tag match?