From 692351ea34f15ba70b23fca68821dc2986de8238 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 8 May 2012 05:15:52 -0400 Subject: MEM: Do not forward uncacheable to bus snoopers This patch adds a guarding if-statement to avoid forwarding uncacheable requests (or rather their corresponding request packets) to bus snoopers. These packets should never have any effect on the caches, and thus there is no need to forward them to the snoopers. --- src/mem/bus.cc | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/mem/bus.cc') diff --git a/src/mem/bus.cc b/src/mem/bus.cc index 61b84d82e..58745326a 100644 --- a/src/mem/bus.cc +++ b/src/mem/bus.cc @@ -217,9 +217,12 @@ Bus::recvTimingReq(PacketPtr pkt) Tick headerFinishTime = pkt->isExpressSnoop() ? 0 : calcPacketTiming(pkt); Tick packetFinishTime = pkt->isExpressSnoop() ? 0 : pkt->finishTime; - // the packet is a memory-mapped request and should be - // broadcasted to our snoopers but the source - forwardTiming(pkt, pkt->getSrc()); + // uncacheable requests need never be snooped + if (!pkt->req->isUncacheable()) { + // the packet is a memory-mapped request and should be + // broadcasted to our snoopers but the source + forwardTiming(pkt, pkt->getSrc()); + } // remember if we add an outstanding req so we can undo it if // necessary, if the packet needs a response, we should add it @@ -543,10 +546,17 @@ Bus::recvAtomic(PacketPtr pkt) slavePorts[pkt->getSrc()]->name(), pkt->getAddr(), pkt->cmdString()); - // forward to all snoopers but the source - std::pair snoop_result = forwardAtomic(pkt, pkt->getSrc()); - MemCmd snoop_response_cmd = snoop_result.first; - Tick snoop_response_latency = snoop_result.second; + MemCmd snoop_response_cmd = MemCmd::InvalidCmd; + Tick snoop_response_latency = 0; + + // uncacheable requests need never be snooped + if (!pkt->req->isUncacheable()) { + // forward to all snoopers but the source + std::pair snoop_result = + forwardAtomic(pkt, pkt->getSrc()); + snoop_response_cmd = snoop_result.first; + snoop_response_latency = snoop_result.second; + } // even if we had a snoop response, we must continue and also // perform the actual request at the destination @@ -643,8 +653,11 @@ Bus::recvFunctional(PacketPtr pkt) pkt->cmdString()); } - // forward to all snoopers but the source - forwardFunctional(pkt, pkt->getSrc()); + // uncacheable requests need never be snooped + if (!pkt->req->isUncacheable()) { + // forward to all snoopers but the source + forwardFunctional(pkt, pkt->getSrc()); + } // there is no need to continue if the snooping has found what we // were looking for and the packet is already a response -- cgit v1.2.3