cache.cc (11130:45a23e44e93d) | cache.cc (11136:3fd483cdd458) |
---|---|
1/* 2 * Copyright (c) 2010-2015 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 --- 1214 unchanged lines hidden (view full) --- 1223 mshr->handleFill(pkt, blk); 1224 1225 blk = handleFill(pkt, blk, writebacks); 1226 assert(blk != NULL); 1227 } 1228 1229 // allow invalidation responses originating from write-line 1230 // requests to be discarded | 1/* 2 * Copyright (c) 2010-2015 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 --- 1214 unchanged lines hidden (view full) --- 1223 mshr->handleFill(pkt, blk); 1224 1225 blk = handleFill(pkt, blk, writebacks); 1226 assert(blk != NULL); 1227 } 1228 1229 // allow invalidation responses originating from write-line 1230 // requests to be discarded |
1231 bool discard_invalidate = false; | 1231 bool is_invalidate = pkt->isInvalidate(); |
1232 1233 // First offset for critical word first calculations 1234 int initial_offset = initial_tgt->pkt->getOffset(blkSize); 1235 1236 while (mshr->hasTargets()) { 1237 MSHR::Target *target = mshr->getTarget(); 1238 Packet *tgt_pkt = target->pkt; 1239 --- 26 unchanged lines hidden (view full) --- 1266 // NB: we use the original packet here and not the response! 1267 mshr->handleFill(tgt_pkt, blk); 1268 blk = handleFill(tgt_pkt, blk, writebacks); 1269 assert(blk != NULL); 1270 1271 // treat as a fill, and discard the invalidation 1272 // response 1273 is_fill = true; | 1232 1233 // First offset for critical word first calculations 1234 int initial_offset = initial_tgt->pkt->getOffset(blkSize); 1235 1236 while (mshr->hasTargets()) { 1237 MSHR::Target *target = mshr->getTarget(); 1238 Packet *tgt_pkt = target->pkt; 1239 --- 26 unchanged lines hidden (view full) --- 1266 // NB: we use the original packet here and not the response! 1267 mshr->handleFill(tgt_pkt, blk); 1268 blk = handleFill(tgt_pkt, blk, writebacks); 1269 assert(blk != NULL); 1270 1271 // treat as a fill, and discard the invalidation 1272 // response 1273 is_fill = true; |
1274 discard_invalidate = true; | 1274 is_invalidate = false; |
1275 } 1276 1277 if (is_fill) { 1278 satisfyCpuSideRequest(tgt_pkt, blk, 1279 true, mshr->hasPostDowngrade()); 1280 1281 // How many bytes past the first request is this one 1282 int transfer_offset = --- 39 unchanged lines hidden (view full) --- 1322 tgt_pkt->setData(pkt->getConstPtr<uint8_t>()); 1323 } 1324 } 1325 tgt_pkt->makeTimingResponse(); 1326 // if this packet is an error copy that to the new packet 1327 if (is_error) 1328 tgt_pkt->copyError(pkt); 1329 if (tgt_pkt->cmd == MemCmd::ReadResp && | 1275 } 1276 1277 if (is_fill) { 1278 satisfyCpuSideRequest(tgt_pkt, blk, 1279 true, mshr->hasPostDowngrade()); 1280 1281 // How many bytes past the first request is this one 1282 int transfer_offset = --- 39 unchanged lines hidden (view full) --- 1322 tgt_pkt->setData(pkt->getConstPtr<uint8_t>()); 1323 } 1324 } 1325 tgt_pkt->makeTimingResponse(); 1326 // if this packet is an error copy that to the new packet 1327 if (is_error) 1328 tgt_pkt->copyError(pkt); 1329 if (tgt_pkt->cmd == MemCmd::ReadResp && |
1330 (pkt->isInvalidate() || mshr->hasPostInvalidate())) { | 1330 (is_invalidate || mshr->hasPostInvalidate())) { |
1331 // If intermediate cache got ReadRespWithInvalidate, 1332 // propagate that. Response should not have 1333 // isInvalidate() set otherwise. 1334 tgt_pkt->cmd = MemCmd::ReadRespWithInvalidate; 1335 DPRINTF(Cache, "%s updated cmd to %s for addr %#llx\n", 1336 __func__, tgt_pkt->cmdString(), tgt_pkt->getAddr()); 1337 } 1338 // Reset the bus additional time as it is now accounted for --- 9 unchanged lines hidden (view full) --- 1348 delete tgt_pkt; 1349 break; 1350 1351 case MSHR::Target::FromSnoop: 1352 // I don't believe that a snoop can be in an error state 1353 assert(!is_error); 1354 // response to snoop request 1355 DPRINTF(Cache, "processing deferred snoop...\n"); | 1331 // If intermediate cache got ReadRespWithInvalidate, 1332 // propagate that. Response should not have 1333 // isInvalidate() set otherwise. 1334 tgt_pkt->cmd = MemCmd::ReadRespWithInvalidate; 1335 DPRINTF(Cache, "%s updated cmd to %s for addr %#llx\n", 1336 __func__, tgt_pkt->cmdString(), tgt_pkt->getAddr()); 1337 } 1338 // Reset the bus additional time as it is now accounted for --- 9 unchanged lines hidden (view full) --- 1348 delete tgt_pkt; 1349 break; 1350 1351 case MSHR::Target::FromSnoop: 1352 // I don't believe that a snoop can be in an error state 1353 assert(!is_error); 1354 // response to snoop request 1355 DPRINTF(Cache, "processing deferred snoop...\n"); |
1356 assert(!(pkt->isInvalidate() && !mshr->hasPostInvalidate())); | 1356 assert(!(is_invalidate && !mshr->hasPostInvalidate())); |
1357 handleSnoop(tgt_pkt, blk, true, true, mshr->hasPostInvalidate()); 1358 break; 1359 1360 default: 1361 panic("Illegal target->source enum %d\n", target->source); 1362 } 1363 1364 mshr->popTarget(); 1365 } 1366 1367 if (blk && blk->isValid()) { 1368 // an invalidate response stemming from a write line request 1369 // should not invalidate the block, so check if the 1370 // invalidation should be discarded | 1357 handleSnoop(tgt_pkt, blk, true, true, mshr->hasPostInvalidate()); 1358 break; 1359 1360 default: 1361 panic("Illegal target->source enum %d\n", target->source); 1362 } 1363 1364 mshr->popTarget(); 1365 } 1366 1367 if (blk && blk->isValid()) { 1368 // an invalidate response stemming from a write line request 1369 // should not invalidate the block, so check if the 1370 // invalidation should be discarded |
1371 if ((pkt->isInvalidate() || mshr->hasPostInvalidate()) && 1372 !discard_invalidate) { | 1371 if (is_invalidate || mshr->hasPostInvalidate()) { |
1373 assert(blk != tempBlock); 1374 tags->invalidate(blk); 1375 blk->invalidate(); 1376 } else if (mshr->hasPostDowngrade()) { 1377 blk->status &= ~BlkWritable; 1378 } 1379 } 1380 --- 1155 unchanged lines hidden --- | 1372 assert(blk != tempBlock); 1373 tags->invalidate(blk); 1374 blk->invalidate(); 1375 } else if (mshr->hasPostDowngrade()) { 1376 blk->status &= ~BlkWritable; 1377 } 1378 } 1379 --- 1155 unchanged lines hidden --- |