cache.cc (11870:b470020b29de) | cache.cc (11892:c7ea349e1cd3) |
---|---|
1/* 2 * Copyright (c) 2010-2016 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 --- 723 unchanged lines hidden (view full) --- 732 // still relying on it; if the block is found in access(), 733 // CleanEvict and Writeback messages will be deleted 734 // here as well 735 pendingDelete.reset(pkt); 736 } 737 } else { 738 // miss 739 | 1/* 2 * Copyright (c) 2010-2016 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 --- 723 unchanged lines hidden (view full) --- 732 // still relying on it; if the block is found in access(), 733 // CleanEvict and Writeback messages will be deleted 734 // here as well 735 pendingDelete.reset(pkt); 736 } 737 } else { 738 // miss 739 |
740 Addr blk_addr = blockAlign(pkt->getAddr()); | 740 Addr blk_addr = pkt->getBlockAddr(blkSize); |
741 742 // ignore any existing MSHR if we are dealing with an 743 // uncacheable request 744 MSHR *mshr = pkt->req->isUncacheable() ? nullptr : 745 mshrQueue.findMatch(blk_addr, pkt->isSecure()); 746 747 // Software prefetch handling: 748 // To keep the core from waiting on data it won't look at --- 207 unchanged lines hidden (view full) --- 956 // of date, however, there is no harm in conservatively 957 // assuming the block has sharers 958 pkt->setHasSharers(); 959 DPRINTF(Cache, "%s: passing hasSharers from %s to %s\n", 960 __func__, cpu_pkt->print(), pkt->print()); 961 } 962 963 // the packet should be block aligned | 741 742 // ignore any existing MSHR if we are dealing with an 743 // uncacheable request 744 MSHR *mshr = pkt->req->isUncacheable() ? nullptr : 745 mshrQueue.findMatch(blk_addr, pkt->isSecure()); 746 747 // Software prefetch handling: 748 // To keep the core from waiting on data it won't look at --- 207 unchanged lines hidden (view full) --- 956 // of date, however, there is no harm in conservatively 957 // assuming the block has sharers 958 pkt->setHasSharers(); 959 DPRINTF(Cache, "%s: passing hasSharers from %s to %s\n", 960 __func__, cpu_pkt->print(), pkt->print()); 961 } 962 963 // the packet should be block aligned |
964 assert(pkt->getAddr() == blockAlign(pkt->getAddr())); | 964 assert(pkt->getAddr() == pkt->getBlockAddr(blkSize)); |
965 966 pkt->allocate(); 967 DPRINTF(Cache, "%s: created %s from %s\n", __func__, pkt->print(), 968 cpu_pkt->print()); 969 return pkt; 970} 971 972 --- 171 unchanged lines hidden (view full) --- 1144 assert(fromCpuSide); 1145 1146 // The cache should be flushed if we are in cache bypass mode, 1147 // so we don't need to check if we need to update anything. 1148 memSidePort->sendFunctional(pkt); 1149 return; 1150 } 1151 | 965 966 pkt->allocate(); 967 DPRINTF(Cache, "%s: created %s from %s\n", __func__, pkt->print(), 968 cpu_pkt->print()); 969 return pkt; 970} 971 972 --- 171 unchanged lines hidden (view full) --- 1144 assert(fromCpuSide); 1145 1146 // The cache should be flushed if we are in cache bypass mode, 1147 // so we don't need to check if we need to update anything. 1148 memSidePort->sendFunctional(pkt); 1149 return; 1150 } 1151 |
1152 Addr blk_addr = blockAlign(pkt->getAddr()); | 1152 Addr blk_addr = pkt->getBlockAddr(blkSize); |
1153 bool is_secure = pkt->isSecure(); 1154 CacheBlk *blk = tags->findBlock(pkt->getAddr(), is_secure); 1155 MSHR *mshr = mshrQueue.findMatch(blk_addr, is_secure); 1156 1157 pkt->pushLabel(name()); 1158 1159 CacheBlkPrintWrapper cbpw(blk); 1160 --- 565 unchanged lines hidden (view full) --- 1726 assert(pkt->isResponse() || pkt->cmd == MemCmd::WriteLineReq); 1727 Addr addr = pkt->getAddr(); 1728 bool is_secure = pkt->isSecure(); 1729#if TRACING_ON 1730 CacheBlk::State old_state = blk ? blk->status : 0; 1731#endif 1732 1733 // When handling a fill, we should have no writes to this line. | 1153 bool is_secure = pkt->isSecure(); 1154 CacheBlk *blk = tags->findBlock(pkt->getAddr(), is_secure); 1155 MSHR *mshr = mshrQueue.findMatch(blk_addr, is_secure); 1156 1157 pkt->pushLabel(name()); 1158 1159 CacheBlkPrintWrapper cbpw(blk); 1160 --- 565 unchanged lines hidden (view full) --- 1726 assert(pkt->isResponse() || pkt->cmd == MemCmd::WriteLineReq); 1727 Addr addr = pkt->getAddr(); 1728 bool is_secure = pkt->isSecure(); 1729#if TRACING_ON 1730 CacheBlk::State old_state = blk ? blk->status : 0; 1731#endif 1732 1733 // When handling a fill, we should have no writes to this line. |
1734 assert(addr == blockAlign(addr)); | 1734 assert(addr == pkt->getBlockAddr(blkSize)); |
1735 assert(!writeBuffer.findMatch(addr, is_secure)); 1736 1737 if (blk == nullptr) { 1738 // better have read new data... 1739 assert(pkt->hasData()); 1740 1741 // only read responses and write-line requests have data; 1742 // note that we don't write the data here for write-line - that --- 344 unchanged lines hidden (view full) --- 2087 // no need to snoop requests that are not in range 2088 if (!inRange(pkt->getAddr())) { 2089 return; 2090 } 2091 2092 bool is_secure = pkt->isSecure(); 2093 CacheBlk *blk = tags->findBlock(pkt->getAddr(), is_secure); 2094 | 1735 assert(!writeBuffer.findMatch(addr, is_secure)); 1736 1737 if (blk == nullptr) { 1738 // better have read new data... 1739 assert(pkt->hasData()); 1740 1741 // only read responses and write-line requests have data; 1742 // note that we don't write the data here for write-line - that --- 344 unchanged lines hidden (view full) --- 2087 // no need to snoop requests that are not in range 2088 if (!inRange(pkt->getAddr())) { 2089 return; 2090 } 2091 2092 bool is_secure = pkt->isSecure(); 2093 CacheBlk *blk = tags->findBlock(pkt->getAddr(), is_secure); 2094 |
2095 Addr blk_addr = blockAlign(pkt->getAddr()); | 2095 Addr blk_addr = pkt->getBlockAddr(blkSize); |
2096 MSHR *mshr = mshrQueue.findMatch(blk_addr, is_secure); 2097 2098 // Update the latency cost of the snoop so that the crossbar can 2099 // account for it. Do not overwrite what other neighbouring caches 2100 // have already done, rather take the maximum. The update is 2101 // tentative, for cases where we return before an upward snoop 2102 // happens below. 2103 pkt->snoopDelay = std::max<uint32_t>(pkt->snoopDelay, --- 172 unchanged lines hidden (view full) --- 2276 } 2277 2278 // fall through... no pending requests. Try a prefetch. 2279 assert(!miss_mshr && !wq_entry); 2280 if (prefetcher && mshrQueue.canPrefetch()) { 2281 // If we have a miss queue slot, we can try a prefetch 2282 PacketPtr pkt = prefetcher->getPacket(); 2283 if (pkt) { | 2096 MSHR *mshr = mshrQueue.findMatch(blk_addr, is_secure); 2097 2098 // Update the latency cost of the snoop so that the crossbar can 2099 // account for it. Do not overwrite what other neighbouring caches 2100 // have already done, rather take the maximum. The update is 2101 // tentative, for cases where we return before an upward snoop 2102 // happens below. 2103 pkt->snoopDelay = std::max<uint32_t>(pkt->snoopDelay, --- 172 unchanged lines hidden (view full) --- 2276 } 2277 2278 // fall through... no pending requests. Try a prefetch. 2279 assert(!miss_mshr && !wq_entry); 2280 if (prefetcher && mshrQueue.canPrefetch()) { 2281 // If we have a miss queue slot, we can try a prefetch 2282 PacketPtr pkt = prefetcher->getPacket(); 2283 if (pkt) { |
2284 Addr pf_addr = blockAlign(pkt->getAddr()); | 2284 Addr pf_addr = pkt->getBlockAddr(blkSize); |
2285 if (!tags->findBlock(pf_addr, pkt->isSecure()) && 2286 !mshrQueue.findMatch(pf_addr, pkt->isSecure()) && 2287 !writeBuffer.findMatch(pf_addr, pkt->isSecure())) { 2288 // Update statistic on number of prefetches issued 2289 // (hwpf_mshr_misses) 2290 assert(pkt->req->masterId() < system->maxMasters()); 2291 mshr_misses[pkt->cmdToIndex()][pkt->req->masterId()]++; 2292 --- 379 unchanged lines hidden --- | 2285 if (!tags->findBlock(pf_addr, pkt->isSecure()) && 2286 !mshrQueue.findMatch(pf_addr, pkt->isSecure()) && 2287 !writeBuffer.findMatch(pf_addr, pkt->isSecure())) { 2288 // Update statistic on number of prefetches issued 2289 // (hwpf_mshr_misses) 2290 assert(pkt->req->masterId() < system->maxMasters()); 2291 mshr_misses[pkt->cmdToIndex()][pkt->req->masterId()]++; 2292 --- 379 unchanged lines hidden --- |