base.cc (12748:ae5ce8e42de7) | base.cc (12749:223c83ed9979) |
---|---|
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 --- 796 unchanged lines hidden (view full) --- 805 mshr_misses[pkt->cmdToIndex()][pkt->req->masterId()]++; 806 807 // allocate an MSHR and return it, note 808 // that we send the packet straight away, so do not 809 // schedule the send 810 return allocateMissBuffer(pkt, curTick(), false); 811 } else { 812 // free the request and packet | 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 --- 796 unchanged lines hidden (view full) --- 805 mshr_misses[pkt->cmdToIndex()][pkt->req->masterId()]++; 806 807 // allocate an MSHR and return it, note 808 // that we send the packet straight away, so do not 809 // schedule the send 810 return allocateMissBuffer(pkt, curTick(), false); 811 } else { 812 // free the request and packet |
813 delete pkt->req; | |
814 delete pkt; 815 } 816 } 817 } 818 819 return nullptr; 820} 821 --- 451 unchanged lines hidden (view full) --- 1273BaseCache::writebackBlk(CacheBlk *blk) 1274{ 1275 chatty_assert(!isReadOnly || writebackClean, 1276 "Writeback from read-only cache"); 1277 assert(blk && blk->isValid() && (blk->isDirty() || writebackClean)); 1278 1279 writebacks[Request::wbMasterId]++; 1280 | 813 delete pkt; 814 } 815 } 816 } 817 818 return nullptr; 819} 820 --- 451 unchanged lines hidden (view full) --- 1272BaseCache::writebackBlk(CacheBlk *blk) 1273{ 1274 chatty_assert(!isReadOnly || writebackClean, 1275 "Writeback from read-only cache"); 1276 assert(blk && blk->isValid() && (blk->isDirty() || writebackClean)); 1277 1278 writebacks[Request::wbMasterId]++; 1279 |
1281 RequestPtr req = new Request(regenerateBlkAddr(blk), blkSize, 0, 1282 Request::wbMasterId); | 1280 RequestPtr req = std::make_shared<Request>( 1281 regenerateBlkAddr(blk), blkSize, 0, Request::wbMasterId); 1282 |
1283 if (blk->isSecure()) 1284 req->setFlags(Request::SECURE); 1285 1286 req->taskId(blk->task_id); 1287 1288 PacketPtr pkt = 1289 new Packet(req, blk->isDirty() ? 1290 MemCmd::WritebackDirty : MemCmd::WritebackClean); --- 17 unchanged lines hidden (view full) --- 1308 pkt->setDataFromBlock(blk->data, blkSize); 1309 1310 return pkt; 1311} 1312 1313PacketPtr 1314BaseCache::writecleanBlk(CacheBlk *blk, Request::Flags dest, PacketId id) 1315{ | 1283 if (blk->isSecure()) 1284 req->setFlags(Request::SECURE); 1285 1286 req->taskId(blk->task_id); 1287 1288 PacketPtr pkt = 1289 new Packet(req, blk->isDirty() ? 1290 MemCmd::WritebackDirty : MemCmd::WritebackClean); --- 17 unchanged lines hidden (view full) --- 1308 pkt->setDataFromBlock(blk->data, blkSize); 1309 1310 return pkt; 1311} 1312 1313PacketPtr 1314BaseCache::writecleanBlk(CacheBlk *blk, Request::Flags dest, PacketId id) 1315{ |
1316 RequestPtr req = new Request(regenerateBlkAddr(blk), blkSize, 0, 1317 Request::wbMasterId); | 1316 RequestPtr req = std::make_shared<Request>( 1317 regenerateBlkAddr(blk), blkSize, 0, Request::wbMasterId); 1318 |
1318 if (blk->isSecure()) { 1319 req->setFlags(Request::SECURE); 1320 } 1321 req->taskId(blk->task_id); 1322 1323 PacketPtr pkt = new Packet(req, MemCmd::WriteClean, blkSize, id); 1324 1325 if (dest) { --- 42 unchanged lines hidden (view full) --- 1368} 1369 1370void 1371BaseCache::writebackVisitor(CacheBlk &blk) 1372{ 1373 if (blk.isDirty()) { 1374 assert(blk.isValid()); 1375 | 1319 if (blk->isSecure()) { 1320 req->setFlags(Request::SECURE); 1321 } 1322 req->taskId(blk->task_id); 1323 1324 PacketPtr pkt = new Packet(req, MemCmd::WriteClean, blkSize, id); 1325 1326 if (dest) { --- 42 unchanged lines hidden (view full) --- 1369} 1370 1371void 1372BaseCache::writebackVisitor(CacheBlk &blk) 1373{ 1374 if (blk.isDirty()) { 1375 assert(blk.isValid()); 1376 |
1376 Request request(regenerateBlkAddr(&blk), 1377 blkSize, 0, Request::funcMasterId); 1378 request.taskId(blk.task_id); | 1377 RequestPtr request = std::make_shared<Request>( 1378 regenerateBlkAddr(&blk), blkSize, 0, Request::funcMasterId); 1379 1380 request->taskId(blk.task_id); |
1379 if (blk.isSecure()) { | 1381 if (blk.isSecure()) { |
1380 request.setFlags(Request::SECURE); | 1382 request->setFlags(Request::SECURE); |
1381 } 1382 | 1383 } 1384 |
1383 Packet packet(&request, MemCmd::WriteReq); | 1385 Packet packet(request, MemCmd::WriteReq); |
1384 packet.dataStatic(blk.data); 1385 1386 memSidePort.sendFunctional(&packet); 1387 1388 blk.status &= ~BlkDirty; 1389 } 1390} 1391 --- 935 unchanged lines hidden --- | 1386 packet.dataStatic(blk.data); 1387 1388 memSidePort.sendFunctional(&packet); 1389 1390 blk.status &= ~BlkDirty; 1391 } 1392} 1393 --- 935 unchanged lines hidden --- |