base.cc (13419:aaadcfae091a) | base.cc (13445:070fc4d948c0) |
---|---|
1/* 2 * Copyright (c) 2012-2013, 2018 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 --- 990 unchanged lines hidden (view full) --- 999 // need to do a replacement 1000 blk = allocateBlock(pkt, writebacks); 1001 if (!blk) { 1002 // no replaceable block available: give up, fwd to next level. 1003 incMissCount(pkt); 1004 return false; 1005 } 1006 | 1/* 2 * Copyright (c) 2012-2013, 2018 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 --- 990 unchanged lines hidden (view full) --- 999 // need to do a replacement 1000 blk = allocateBlock(pkt, writebacks); 1001 if (!blk) { 1002 // no replaceable block available: give up, fwd to next level. 1003 incMissCount(pkt); 1004 return false; 1005 } 1006 |
1007 blk->status |= (BlkValid | BlkReadable); | 1007 blk->status |= BlkReadable; |
1008 } 1009 // only mark the block dirty if we got a writeback command, 1010 // and leave it as is for a clean writeback 1011 if (pkt->cmd == MemCmd::WritebackDirty) { 1012 // TODO: the coherent cache can assert(!blk->isDirty()); 1013 blk->status |= BlkDirty; 1014 } 1015 // if the packet does not have sharers, it is passing --- 41 unchanged lines hidden (view full) --- 1057 blk = allocateBlock(pkt, writebacks); 1058 if (!blk) { 1059 // no replaceable block available: give up, fwd to 1060 // next level. 1061 incMissCount(pkt); 1062 return false; 1063 } 1064 | 1008 } 1009 // only mark the block dirty if we got a writeback command, 1010 // and leave it as is for a clean writeback 1011 if (pkt->cmd == MemCmd::WritebackDirty) { 1012 // TODO: the coherent cache can assert(!blk->isDirty()); 1013 blk->status |= BlkDirty; 1014 } 1015 // if the packet does not have sharers, it is passing --- 41 unchanged lines hidden (view full) --- 1057 blk = allocateBlock(pkt, writebacks); 1058 if (!blk) { 1059 // no replaceable block available: give up, fwd to 1060 // next level. 1061 incMissCount(pkt); 1062 return false; 1063 } 1064 |
1065 blk->status |= (BlkValid | BlkReadable); | 1065 blk->status |= BlkReadable; |
1066 } 1067 } 1068 1069 // at this point either this is a writeback or a write-through 1070 // write clean operation and the block is already in this 1071 // cache, we need to update the data and the block flags 1072 assert(blk); 1073 // TODO: the coherent cache can assert(!blk->isDirty()); --- 70 unchanged lines hidden (view full) --- 1144 // need to do a replacement if allocating, otherwise we stick 1145 // with the temporary storage 1146 blk = allocate ? allocateBlock(pkt, writebacks) : nullptr; 1147 1148 if (!blk) { 1149 // No replaceable block or a mostly exclusive 1150 // cache... just use temporary storage to complete the 1151 // current request and then get rid of it | 1066 } 1067 } 1068 1069 // at this point either this is a writeback or a write-through 1070 // write clean operation and the block is already in this 1071 // cache, we need to update the data and the block flags 1072 assert(blk); 1073 // TODO: the coherent cache can assert(!blk->isDirty()); --- 70 unchanged lines hidden (view full) --- 1144 // need to do a replacement if allocating, otherwise we stick 1145 // with the temporary storage 1146 blk = allocate ? allocateBlock(pkt, writebacks) : nullptr; 1147 1148 if (!blk) { 1149 // No replaceable block or a mostly exclusive 1150 // cache... just use temporary storage to complete the 1151 // current request and then get rid of it |
1152 assert(!tempBlock->isValid()); | |
1153 blk = tempBlock; 1154 tempBlock->insert(addr, is_secure); 1155 DPRINTF(Cache, "using temp block for %#llx (%s)\n", addr, 1156 is_secure ? "s" : "ns"); 1157 } | 1152 blk = tempBlock; 1153 tempBlock->insert(addr, is_secure); 1154 DPRINTF(Cache, "using temp block for %#llx (%s)\n", addr, 1155 is_secure ? "s" : "ns"); 1156 } |
1158 1159 // we should never be overwriting a valid block 1160 assert(!blk->isValid()); | |
1161 } else { 1162 // existing block... probably an upgrade | 1157 } else { 1158 // existing block... probably an upgrade |
1163 assert(regenerateBlkAddr(blk) == addr); 1164 assert(blk->isSecure() == is_secure); 1165 // either we're getting new data or the block should already be valid 1166 assert(pkt->hasData() || blk->isValid()); | |
1167 // don't clear block status... if block is already dirty we 1168 // don't want to lose that 1169 } 1170 | 1159 // don't clear block status... if block is already dirty we 1160 // don't want to lose that 1161 } 1162 |
1171 blk->status |= BlkValid | BlkReadable; | 1163 // Block is guaranteed to be valid at this point 1164 assert(blk->isValid()); 1165 assert(blk->isSecure() == is_secure); 1166 assert(regenerateBlkAddr(blk) == addr); |
1172 | 1167 |
1168 blk->status |= BlkReadable; 1169 |
|
1173 // sanity check for whole-line writes, which should always be 1174 // marked as writable as part of the fill, and then later marked 1175 // dirty as part of satisfyRequest 1176 if (pkt->cmd == MemCmd::InvalidateResp) { 1177 assert(!pkt->hasSharers()); 1178 } 1179 1180 // here we deal with setting the appropriate state of the line, --- 1268 unchanged lines hidden --- | 1170 // sanity check for whole-line writes, which should always be 1171 // marked as writable as part of the fill, and then later marked 1172 // dirty as part of satisfyRequest 1173 if (pkt->cmd == MemCmd::InvalidateResp) { 1174 assert(!pkt->hasSharers()); 1175 } 1176 1177 // here we deal with setting the appropriate state of the line, --- 1268 unchanged lines hidden --- |