diff options
-rw-r--r-- | src/mem/bus.cc | 24 |
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 |