summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dev/io_device.cc2
-rw-r--r--src/mem/bus.cc3
-rw-r--r--src/mem/physical.cc1
3 files changed, 5 insertions, 1 deletions
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);