1/* 2 * Copyright (c) 2012-2014,2017 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 101 unchanged lines hidden (view full) --- 110 * updates the replacement data. 111 * 112 * @param blk The block to invalidate. 113 */ 114 void invalidate(CacheBlk *blk) override; 115 116 /** 117 * Access block and update replacement data. May not succeed, in which case |
118 * nullptr is returned. This has all the implications of a cache access and 119 * should only be used as such. Returns the tag lookup latency as a side 120 * effect. 121 * |
122 * @param addr The address to find. 123 * @param is_secure True if the target memory space is secure. |
124 * @param lat The latency of the tag lookup. |
125 * @return Pointer to the cache block if found. 126 */ 127 CacheBlk* accessBlock(Addr addr, bool is_secure, Cycles &lat) override 128 { 129 CacheBlk *blk = findBlock(addr, is_secure); 130 131 // Access all tags in parallel, hence one in each way. The data side 132 // either accesses all blocks in parallel, or one block sequentially on 133 // a hit. Sequential access with a miss doesn't access data. 134 tagAccesses += allocAssoc; 135 if (sequentialAccess) { 136 if (blk != nullptr) { 137 dataAccesses += 1; 138 } 139 } else { 140 dataAccesses += allocAssoc; 141 } 142 |
143 // If a cache hit |
144 if (blk != nullptr) { |
145 // Update number of references to accessed block 146 blk->refCount++; 147 148 // Update replacement data of accessed block 149 replacementPolicy->touch(blk->replacementData); |
150 } 151 |
152 // The tag lookup latency is the same for a hit or a miss 153 lat = lookupLatency; 154 |
155 return blk; 156 } 157 158 /** 159 * Find replacement victim based on address. The list of evicted blocks 160 * only contains the victim. 161 * 162 * @param addr Address to find a victim for. --- 91 unchanged lines hidden --- |