summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Hestness <hestness@cs.utexas.edu>2011-02-06 22:14:18 -0800
committerJoel Hestness <hestness@cs.utexas.edu>2011-02-06 22:14:18 -0800
commit52b611922849d8e3ca6fb3aa0176a8d85e91e922 (patch)
tree1238415b5e1ed8be3166e69fd7498333c10902b4
parent2da54d1285a506c3ba01ff8cdcaa95fcdfccccdb (diff)
downloadgem5-52b611922849d8e3ca6fb3aa0176a8d85e91e922.tar.xz
TimingSimpleCPU: split data sender state fix
In sendSplitData, keep a pointer to the senderState that may be updated after the call to handle*Packet. This way, if the receiver updates the packet senderState, it can still be accessed in sendSplitData.
-rw-r--r--src/cpu/simple/timing.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc
index 47f99cd6d..453699f84 100644
--- a/src/cpu/simple/timing.cc
+++ b/src/cpu/simple/timing.cc
@@ -325,26 +325,26 @@ TimingSimpleCPU::sendSplitData(RequestPtr req1, RequestPtr req2,
pkt1->makeResponse();
completeDataAccess(pkt1);
} else if (read) {
+ SplitFragmentSenderState * send_state =
+ dynamic_cast<SplitFragmentSenderState *>(pkt1->senderState);
if (handleReadPacket(pkt1)) {
- SplitFragmentSenderState * send_state =
- dynamic_cast<SplitFragmentSenderState *>(pkt1->senderState);
send_state->clearFromParent();
+ send_state = dynamic_cast<SplitFragmentSenderState *>(
+ pkt2->senderState);
if (handleReadPacket(pkt2)) {
- send_state = dynamic_cast<SplitFragmentSenderState *>(
- pkt1->senderState);
send_state->clearFromParent();
}
}
} else {
dcache_pkt = pkt1;
+ SplitFragmentSenderState * send_state =
+ dynamic_cast<SplitFragmentSenderState *>(pkt1->senderState);
if (handleWritePacket()) {
- SplitFragmentSenderState * send_state =
- dynamic_cast<SplitFragmentSenderState *>(pkt1->senderState);
send_state->clearFromParent();
dcache_pkt = pkt2;
+ send_state = dynamic_cast<SplitFragmentSenderState *>(
+ pkt2->senderState);
if (handleWritePacket()) {
- send_state = dynamic_cast<SplitFragmentSenderState *>(
- pkt1->senderState);
send_state->clearFromParent();
}
}