summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/bus.cc31
-rw-r--r--src/mem/bus.hh4
2 files changed, 19 insertions, 16 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index a9f95fdc7..92722fd97 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -331,17 +331,19 @@ Bus::findSnoopPorts(Addr addr, int id)
}
Tick
-Bus::atomicSnoop(PacketPtr pkt)
+Bus::atomicSnoop(PacketPtr pkt, Port *responder)
{
std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc());
Tick response_time = 0;
while (!ports.empty())
{
- Tick response = interfaces[ports.back()]->sendAtomic(pkt);
- if (response) {
- assert(!response_time); //Multiple responders
- response_time = response;
+ if (interfaces[ports.back()] != responder) {
+ Tick response = interfaces[ports.back()]->sendAtomic(pkt);
+ if (response) {
+ assert(!response_time); //Multiple responders
+ response_time = response;
+ }
}
ports.pop_back();
}
@@ -349,7 +351,7 @@ Bus::atomicSnoop(PacketPtr pkt)
}
void
-Bus::functionalSnoop(PacketPtr pkt)
+Bus::functionalSnoop(PacketPtr pkt, Port *responder)
{
std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc());
@@ -357,7 +359,8 @@ Bus::functionalSnoop(PacketPtr pkt)
int id = pkt->getSrc();
while (!ports.empty() && pkt->result != Packet::Success)
{
- interfaces[ports.back()]->sendFunctional(pkt);
+ if (interfaces[ports.back()] != responder)
+ interfaces[ports.back()]->sendFunctional(pkt);
ports.pop_back();
pkt->setSrc(id);
}
@@ -394,12 +397,13 @@ Bus::recvAtomic(PacketPtr pkt)
// some clock skew issues yet again...
pkt->finishTime = curTick + clock;
- Tick snoopTime = atomicSnoop(pkt);
+ Port *port = findPort(pkt->getAddr(), pkt->getSrc());
+ Tick snoopTime = atomicSnoop(pkt, port);
if (snoopTime)
return snoopTime; //Snoop satisfies it
else
- return findPort(pkt->getAddr(), pkt->getSrc())->sendAtomic(pkt);
+ return port->sendAtomic(pkt);
}
/** Function called by the port when the bus is receiving a Functional
@@ -412,13 +416,12 @@ Bus::recvFunctional(PacketPtr pkt)
assert(pkt->getDest() == Packet::Broadcast);
pkt->flags |= SNOOP_COMMIT;
- functionalSnoop(pkt);
+ Port* port = findPort(pkt->getAddr(), pkt->getSrc());
+ functionalSnoop(pkt, port ? port : interfaces[pkt->getSrc()]);
// If the snooping found what we were looking for, we're done.
- if (pkt->result != Packet::Success) {
- Port* port = findPort(pkt->getAddr(), pkt->getSrc());
- if (port)
- port->sendFunctional(pkt);
+ if (pkt->result != Packet::Success && port) {
+ port->sendFunctional(pkt);
}
}
diff --git a/src/mem/bus.hh b/src/mem/bus.hh
index 7169a8e6d..c472b6143 100644
--- a/src/mem/bus.hh
+++ b/src/mem/bus.hh
@@ -109,10 +109,10 @@ class Bus : public MemObject
std::vector<int> findSnoopPorts(Addr addr, int id);
/** Snoop all relevant ports atomicly. */
- Tick atomicSnoop(PacketPtr pkt);
+ Tick atomicSnoop(PacketPtr pkt, Port* responder);
/** Snoop all relevant ports functionally. */
- void functionalSnoop(PacketPtr pkt);
+ void functionalSnoop(PacketPtr pkt, Port *responder);
/** Call snoop on caches, be sure to set SNOOP_COMMIT bit if you want
* the snoop to happen