summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-11-13 19:56:34 -0500
committerRon Dreslinski <rdreslin@umich.edu>2006-11-13 19:56:34 -0500
commit6c5c51338d85f54953d11fefd956baceed37c010 (patch)
tree4830c147a3e7ede41cf10f790d59bf574ca1fda8 /src
parentdfc82bdcfc6526f338969d224ab52fa6700cb295 (diff)
downloadgem5-6c5c51338d85f54953d11fefd956baceed37c010.tar.xz
Fix problems with snoop ranges not working properly on functional accesses
src/mem/bus.cc: Actually return the snoop list when asked for it. Don't get stuck in infinite functional loops --HG-- extra : convert_revision : 8e6dafbd10b30d48d28b6b5d4b464e8e8f6a3ddc
Diffstat (limited to 'src')
-rw-r--r--src/mem/bus.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index 8ea67a0e4..8b77011bb 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -290,7 +290,10 @@ Bus::findPort(Addr addr, int id)
// we shouldn't be sending this back to where it came from
- assert(dest_id != id);
+ // only on a functional access and then we should terminate
+ // the cyclical call.
+ if (dest_id == id)
+ return 0;
return interfaces[dest_id];
}
@@ -392,8 +395,11 @@ Bus::recvFunctional(PacketPtr pkt)
functionalSnoop(pkt);
// If the snooping found what we were looking for, we're done.
- if (pkt->result != Packet::Success)
- findPort(pkt->getAddr(), pkt->getSrc())->sendFunctional(pkt);
+ if (pkt->result != Packet::Success) {
+ Port* port = findPort(pkt->getAddr(), pkt->getSrc());
+ if (port)
+ port->sendFunctional(pkt);
+ }
}
/** Function called by the port when the bus is receiving a status change.*/
@@ -493,7 +499,7 @@ Bus::addressRanges(AddrRangeList &resp, AddrRangeList &snoop, int id)
for (dflt_iter = defaultRange.begin(); dflt_iter != defaultRange.end();
dflt_iter++) {
resp.push_back(*dflt_iter);
- DPRINTF(BusAddrRanges, " -- %#llx : %#llx\n",dflt_iter->start,
+ DPRINTF(BusAddrRanges, " -- Dflt: %#llx : %#llx\n",dflt_iter->start,
dflt_iter->end);
}
for (portIter = portList.begin(); portIter != portList.end(); portIter++) {
@@ -519,6 +525,16 @@ Bus::addressRanges(AddrRangeList &resp, AddrRangeList &snoop, int id)
portIter->range.start, portIter->range.end);
}
}
+
+ for (portIter = portSnoopList.begin();
+ portIter != portSnoopList.end(); portIter++)
+ {
+ if (portIter->portId != id) {
+ snoop.push_back(portIter->range);
+ DPRINTF(BusAddrRanges, " -- Snoop: %#llx : %#llx\n",
+ portIter->range.start, portIter->range.end);
+ }
+ }
}
unsigned int