base_set_assoc.hh (11169:44b5c183c3cd) | base_set_assoc.hh (11484:08b33c52a16d) |
---|---|
1/* 2 * Copyright (c) 2012-2014 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 --- 179 unchanged lines hidden (view full) --- 188 occupancies[blk->srcMasterId]--; 189 blk->srcMasterId = Request::invldMasterId; 190 blk->task_id = ContextSwitchTaskId::Unknown; 191 blk->tickInserted = curTick(); 192 } 193 194 /** 195 * Access block and update replacement data. May not succeed, in which case | 1/* 2 * Copyright (c) 2012-2014 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 --- 179 unchanged lines hidden (view full) --- 188 occupancies[blk->srcMasterId]--; 189 blk->srcMasterId = Request::invldMasterId; 190 blk->task_id = ContextSwitchTaskId::Unknown; 191 blk->tickInserted = curTick(); 192 } 193 194 /** 195 * Access block and update replacement data. May not succeed, in which case |
196 * NULL pointer is returned. This has all the implications of a cache | 196 * nullptr is returned. This has all the implications of a cache |
197 * access and should only be used as such. Returns the access latency as a 198 * side effect. 199 * @param addr The address to find. 200 * @param is_secure True if the target memory space is secure. 201 * @param asid The address space ID. 202 * @param lat The access latency. 203 * @return Pointer to the cache block if found. 204 */ --- 5 unchanged lines hidden (view full) --- 210 BlkType *blk = sets[set].findBlk(tag, is_secure); 211 lat = accessLatency;; 212 213 // Access all tags in parallel, hence one in each way. The data side 214 // either accesses all blocks in parallel, or one block sequentially on 215 // a hit. Sequential access with a miss doesn't access data. 216 tagAccesses += allocAssoc; 217 if (sequentialAccess) { | 197 * access and should only be used as such. Returns the access latency as a 198 * side effect. 199 * @param addr The address to find. 200 * @param is_secure True if the target memory space is secure. 201 * @param asid The address space ID. 202 * @param lat The access latency. 203 * @return Pointer to the cache block if found. 204 */ --- 5 unchanged lines hidden (view full) --- 210 BlkType *blk = sets[set].findBlk(tag, is_secure); 211 lat = accessLatency;; 212 213 // Access all tags in parallel, hence one in each way. The data side 214 // either accesses all blocks in parallel, or one block sequentially on 215 // a hit. Sequential access with a miss doesn't access data. 216 tagAccesses += allocAssoc; 217 if (sequentialAccess) { |
218 if (blk != NULL) { | 218 if (blk != nullptr) { |
219 dataAccesses += 1; 220 } 221 } else { 222 dataAccesses += allocAssoc; 223 } 224 | 219 dataAccesses += 1; 220 } 221 } else { 222 dataAccesses += allocAssoc; 223 } 224 |
225 if (blk != NULL) { | 225 if (blk != nullptr) { |
226 if (blk->whenReady > curTick() 227 && cache->ticksToCycles(blk->whenReady - curTick()) 228 > accessLatency) { 229 lat = cache->ticksToCycles(blk->whenReady - curTick()); 230 } 231 blk->refCount += 1; 232 } 233 --- 14 unchanged lines hidden (view full) --- 248 * Find an invalid block to evict for the address provided. 249 * If there are no invalid blocks, this will return the block 250 * in the least-recently-used position. 251 * @param addr The addr to a find a replacement candidate for. 252 * @return The candidate block. 253 */ 254 CacheBlk* findVictim(Addr addr) override 255 { | 226 if (blk->whenReady > curTick() 227 && cache->ticksToCycles(blk->whenReady - curTick()) 228 > accessLatency) { 229 lat = cache->ticksToCycles(blk->whenReady - curTick()); 230 } 231 blk->refCount += 1; 232 } 233 --- 14 unchanged lines hidden (view full) --- 248 * Find an invalid block to evict for the address provided. 249 * If there are no invalid blocks, this will return the block 250 * in the least-recently-used position. 251 * @param addr The addr to a find a replacement candidate for. 252 * @return The candidate block. 253 */ 254 CacheBlk* findVictim(Addr addr) override 255 { |
256 BlkType *blk = NULL; | 256 BlkType *blk = nullptr; |
257 int set = extractSet(addr); 258 259 // prefer to evict an invalid block 260 for (int i = 0; i < allocAssoc; ++i) { 261 blk = sets[set].blks[i]; 262 if (!blk->isValid()) 263 break; 264 } --- 154 unchanged lines hidden --- | 257 int set = extractSet(addr); 258 259 // prefer to evict an invalid block 260 for (int i = 0; i < allocAssoc; ++i) { 261 blk = sets[set].blks[i]; 262 if (!blk->isValid()) 263 break; 264 } --- 154 unchanged lines hidden --- |