From: Steve Reinhardt Date: Tue, 23 May 2006 21:16:45 +0000 (-0400) Subject: Minor fixes for full-system timing memory. X-Git-Tag: m5_2.0_beta1~71^2~5 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf826ae296a4277bdf2ce46e4484295efde5a3c2;p=gem5.git Minor fixes for full-system timing memory. Need to rewrite bus bridge to get any further. src/dev/io_device.cc: Set packet dest on timing responses. src/mem/bus.cc: Fix dest addr bounds check assertion. Add assertion to catch infinite loopbacks. src/mem/physical.cc: Add comment. --HG-- extra : convert_revision : 419b65a3a61e2d099884dbda117b338dffd80896 --- diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index 634b11b7e..5f7770a92 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -78,6 +78,8 @@ bool PioPort::recvTiming(Packet *pkt) { device->recvAtomic(pkt); + // turn packet around to go back to requester + pkt->dest = pkt->src; sendTiming(pkt, pkt->time - pkt->req->getTime()); return Success; } diff --git a/src/mem/bus.cc b/src/mem/bus.cc index f7c2b874a..e8dfbc2e6 100644 --- a/src/mem/bus.cc +++ b/src/mem/bus.cc @@ -54,7 +54,8 @@ Bus::recvTiming(Packet *pkt) if (pkt->dest == Packet::Broadcast) { port = findPort(pkt->addr, pkt->src); } else { - assert(pkt->dest > 0 && pkt->dest < interfaces.size()); + assert(pkt->dest >= 0 && pkt->dest < interfaces.size()); + assert(pkt->dest != pkt->src); // catch infinite loops port = interfaces[pkt->dest]; } return port->sendTiming(pkt); diff --git a/src/mem/physical.cc b/src/mem/physical.cc index bc2500678..75179f9e3 100644 --- a/src/mem/physical.cc +++ b/src/mem/physical.cc @@ -127,6 +127,7 @@ PhysicalMemory::doTimingAccess (Packet *pkt, MemoryPort* memoryPort) { doFunctionalAccess(pkt); + // turn packet around to go back to requester pkt->dest = pkt->src; MemResponseEvent* response = new MemResponseEvent(pkt, memoryPort); response->schedule(curTick + lat);