summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-11-14 01:12:52 -0500
committerRon Dreslinski <rdreslin@umich.edu>2006-11-14 01:12:52 -0500
commit4135dd48ed0e876e11a935240d5436a421db12c6 (patch)
tree8a12bcb5b87ceae699d9d8086903068857ba101d
parent7babf6b3a89dffdef108c0d68057eabc491dcc50 (diff)
downloadgem5-4135dd48ed0e876e11a935240d5436a421db12c6.tar.xz
Update bus bridges now that snoop ranges are passed properly
src/mem/bridge.cc: Update brdiges, now that snoop addresses are properly forwarded. Bus bridge should only handle snoops on the second phase (SNOOP_COMMIT) src/mem/bus.cc: src/mem/bus.hh: Make sure if a busBridge has access to both things that snoop and things that respond it only takes the request once --HG-- extra : convert_revision : 26cc9ee4429be45d4476fa435e0e9a54843c2509
-rw-r--r--src/mem/bridge.cc12
-rw-r--r--src/mem/bus.cc16
-rw-r--r--src/mem/bus.hh2
3 files changed, 21 insertions, 9 deletions
diff --git a/src/mem/bridge.cc b/src/mem/bridge.cc
index 38dcfd2e8..b787f79ca 100644
--- a/src/mem/bridge.cc
+++ b/src/mem/bridge.cc
@@ -91,10 +91,16 @@ Bridge::init()
bool
Bridge::BridgePort::recvTiming(PacketPtr pkt)
{
- DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n",
- pkt->getSrc(), pkt->getDest(), pkt->getAddr());
+ if (pkt->flags & SNOOP_COMMIT) {
+ DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n",
+ pkt->getSrc(), pkt->getDest(), pkt->getAddr());
- return otherPort->queueForSendTiming(pkt);
+ return otherPort->queueForSendTiming(pkt);
+ }
+ else {
+ // Else it's just a snoop, properly return if we are blocking
+ return !queueFull();
+ }
}
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index b97a7ddb9..a9f95fdc7 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -160,11 +160,12 @@ Bus::recvTiming(PacketPtr pkt)
short dest = pkt->getDest();
if (dest == Packet::Broadcast) {
- if (timingSnoop(pkt)) {
+ port = findPort(pkt->getAddr(), pkt->getSrc());
+ if (timingSnoop(pkt, port)) {
bool success;
pkt->flags |= SNOOP_COMMIT;
- success = timingSnoop(pkt);
+ success = timingSnoop(pkt, port);
assert(success);
if (pkt->flags & SATISFIED) {
@@ -177,7 +178,6 @@ Bus::recvTiming(PacketPtr pkt)
occupyBus(pkt);
return true;
}
- port = findPort(pkt->getAddr(), pkt->getSrc());
} else {
//Snoop didn't succeed
DPRINTF(Bus, "Adding a retry to RETRY list %i\n", pktPort);
@@ -364,14 +364,15 @@ Bus::functionalSnoop(PacketPtr pkt)
}
bool
-Bus::timingSnoop(PacketPtr pkt)
+Bus::timingSnoop(PacketPtr pkt, Port* responder)
{
std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc());
bool success = true;
while (!ports.empty() && success)
{
- success = interfaces[ports.back()]->sendTiming(pkt);
+ if (interfaces[ports.back()] != responder) //Don't call if responder also, once will do
+ success = interfaces[ports.back()]->sendTiming(pkt);
ports.pop_back();
}
@@ -387,11 +388,14 @@ Bus::recvAtomic(PacketPtr pkt)
DPRINTF(Bus, "recvAtomic: packet src %d dest %d addr 0x%x cmd %s\n",
pkt->getSrc(), pkt->getDest(), pkt->getAddr(), pkt->cmdString());
assert(pkt->getDest() == Packet::Broadcast);
+ pkt->flags |= SNOOP_COMMIT;
// Assume one bus cycle in order to get through. This may have
// some clock skew issues yet again...
pkt->finishTime = curTick + clock;
+
Tick snoopTime = atomicSnoop(pkt);
+
if (snoopTime)
return snoopTime; //Snoop satisfies it
else
@@ -406,6 +410,8 @@ Bus::recvFunctional(PacketPtr pkt)
DPRINTF(Bus, "recvFunctional: packet src %d dest %d addr 0x%x cmd %s\n",
pkt->getSrc(), pkt->getDest(), pkt->getAddr(), pkt->cmdString());
assert(pkt->getDest() == Packet::Broadcast);
+ pkt->flags |= SNOOP_COMMIT;
+
functionalSnoop(pkt);
// If the snooping found what we were looking for, we're done.
diff --git a/src/mem/bus.hh b/src/mem/bus.hh
index ff1d2545d..7169a8e6d 100644
--- a/src/mem/bus.hh
+++ b/src/mem/bus.hh
@@ -118,7 +118,7 @@ class Bus : public MemObject
* the snoop to happen
* @return True if succeds.
*/
- bool timingSnoop(PacketPtr pkt);
+ bool timingSnoop(PacketPtr pkt, Port *responder);
/** Process address range request.
* @param resp addresses that we can respond to