457a458,489
> void
> Cache::doWritebacksAtomic(PacketList& writebacks)
> {
> while (!writebacks.empty()) {
> PacketPtr wbPkt = writebacks.front();
> // Call isCachedAbove for both Writebacks and CleanEvicts. If
> // isCachedAbove returns true we set BLOCK_CACHED flag in Writebacks
> // and discard CleanEvicts.
> if (isCachedAbove(wbPkt, false)) {
> if (wbPkt->cmd == MemCmd::Writeback) {
> // Set BLOCK_CACHED flag in Writeback and send below,
> // so that the Writeback does not reset the bit
> // corresponding to this address in the snoop filter
> // below. We can discard CleanEvicts because cached
> // copies exist above. Atomic mode isCachedAbove
> // modifies packet to set BLOCK_CACHED flag
> memSidePort->sendAtomic(wbPkt);
> }
> } else {
> // If the block is not cached above, send packet below. Both
> // CleanEvict and Writeback with BLOCK_CACHED flag cleared will
> // reset the bit corresponding to this address in the snoop filter
> // below.
> memSidePort->sendAtomic(wbPkt);
> }
> writebacks.pop_front();
> // In case of CleanEvicts, the packet destructor will delete the
> // request object because this is a non-snoop request packet which
> // does not require a response.
> delete wbPkt;
> }
> }
458a491
>
956,961c989
< while (!writebacks.empty()){
< PacketPtr wbPkt = writebacks.front();
< memSidePort->sendAtomic(wbPkt);
< writebacks.pop_front();
< delete wbPkt;
< }
---
> doWritebacksAtomic(writebacks);
1043,1048c1071
< while (!writebacks.empty()){
< PacketPtr wbPkt = writebacks.front();
< memSidePort->sendAtomic(wbPkt);
< writebacks.pop_front();
< delete wbPkt;
< }
---
> doWritebacksAtomic(writebacks);
1909c1932
< // no need to snoop writebacks or requests that are not in range
---
> // no need to snoop requests that are not in range
2047,2051c2070,2071
< // no need to snoop writebacks or requests that are not in range. In
< // atomic we have no Writebacks/CleanEvicts queued and no prefetches,
< // hence there is no need to snoop upwards and determine if they are
< // present above.
< if (pkt->evictingBlock() || !inRange(pkt->getAddr())) {
---
> // no need to snoop requests that are not in range.
> if (!inRange(pkt->getAddr())) {
2147c2167
< Cache::isCachedAbove(const PacketPtr pkt) const
---
> Cache::isCachedAbove(PacketPtr pkt, bool is_timing) const
2156,2167c2176,2191
<
< Packet snoop_pkt(pkt, true, false);
< snoop_pkt.setExpressSnoop();
< // Assert that packet is either Writeback or CleanEvict and not a prefetch
< // request because prefetch requests need an MSHR and may generate a snoop
< // response.
< assert(pkt->evictingBlock());
< snoop_pkt.senderState = NULL;
< cpuSidePort->sendTimingSnoopReq(&snoop_pkt);
< // Writeback/CleanEvict snoops do not generate a separate snoop response.
< assert(!(snoop_pkt.memInhibitAsserted()));
< return snoop_pkt.isBlockCached();
---
> if (is_timing) {
> Packet snoop_pkt(pkt, true, false);
> snoop_pkt.setExpressSnoop();
> // Assert that packet is either Writeback or CleanEvict and not a
> // prefetch request because prefetch requests need an MSHR and may
> // generate a snoop response.
> assert(pkt->evictingBlock());
> snoop_pkt.senderState = NULL;
> cpuSidePort->sendTimingSnoopReq(&snoop_pkt);
> // Writeback/CleanEvict snoops do not generate a snoop response.
> assert(!(snoop_pkt.memInhibitAsserted()));
> return snoop_pkt.isBlockCached();
> } else {
> cpuSidePort->sendAtomicSnoop(pkt);
> return pkt->isBlockCached();
> }