mem: addr_mapper: restore old address if request not sent
authorChristoph Pfister <pfistchr@student.ethz.ch>
Sat, 30 May 2015 11:45:17 +0000 (13:45 +0200)
committerChristoph Pfister <pfistchr@student.ethz.ch>
Sat, 30 May 2015 11:45:17 +0000 (13:45 +0200)
Committed by: Nilay Vaish <nilay@cs.wisc.edu>

src/mem/addr_mapper.cc

index 06237745bead8d0385dfe3a45ac7ead4f2d743f0..2f00205768e3e8408c5d40a504fc49c727d9cb8d 100644 (file)
@@ -128,9 +128,13 @@ AddrMapper::recvTimingReq(PacketPtr pkt)
     // packets)
     bool successful = masterPort.sendTimingReq(pkt);
 
-    // If not successful, restore the sender state
-    if (!successful && needsResponse) {
-        delete pkt->popSenderState();
+    // If not successful, restore the address and sender state
+    if (!successful) {
+        pkt->setAddr(orig_addr);
+
+        if (needsResponse) {
+            delete pkt->popSenderState();
+        }
     }
 
     return successful;