Deleted Added
sdiff udiff text old ( 13378:038ea95fd793 ) new ( 13418:08101e89101e )
full compact
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
119 * access and should only be used as such. Returns the access latency as a
120 * side effect.
121 * @param addr The address to find.
122 * @param is_secure True if the target memory space is secure.
123 * @param lat The access latency.
124 * @return Pointer to the cache block if found.
125 */
126 CacheBlk* accessBlock(Addr addr, bool is_secure, Cycles &lat) override
127 {
128 CacheBlk *blk = findBlock(addr, is_secure);
129
130 // Access all tags in parallel, hence one in each way. The data side
131 // either accesses all blocks in parallel, or one block sequentially on
132 // a hit. Sequential access with a miss doesn't access data.
133 tagAccesses += allocAssoc;
134 if (sequentialAccess) {
135 if (blk != nullptr) {
136 dataAccesses += 1;
137 }
138 } else {
139 dataAccesses += allocAssoc;
140 }
141
142 if (blk != nullptr) {
143 // If a cache hit
144 lat = accessLatency;
145 // Check if the block to be accessed is available. If not,
146 // apply the accessLatency on top of block->whenReady.
147 if (blk->whenReady > curTick() &&
148 cache->ticksToCycles(blk->whenReady - curTick()) >
149 accessLatency) {
150 lat = cache->ticksToCycles(blk->whenReady - curTick()) +
151 accessLatency;
152 }
153
154 // Update number of references to accessed block
155 blk->refCount++;
156
157 // Update replacement data of accessed block
158 replacementPolicy->touch(blk->replacementData);
159 } else {
160 // If a cache miss
161 lat = lookupLatency;
162 }
163
164 return blk;
165 }
166
167 /**
168 * Find replacement victim based on address. The list of evicted blocks
169 * only contains the victim.
170 *
171 * @param addr Address to find a victim for.

--- 91 unchanged lines hidden ---