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
This commit is contained in:
Ron Dreslinski 2006-11-13 19:56:34 -05:00
parent dfc82bdcfc
commit 6c5c51338d

View file

@ -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