summaryrefslogtreecommitdiff
path: root/src/mem/bridge.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:05 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:05 -0500
commit0622f30961fc32b967bb1ef784afc5a205b16f6e (patch)
treeb6b57cf049b7fc7e49cc65a735af7508862b9c24 /src/mem/bridge.cc
parentf69d431ede9b815ea4b63a2d20237ed3e79df169 (diff)
downloadgem5-0622f30961fc32b967bb1ef784afc5a205b16f6e.tar.xz
mem: Add predecessor to SenderState base class
This patch adds a predecessor field to the SenderState base class to make the process of linking them up more uniform, and enable a traversal of the stack without knowing the specific type of the subclasses. There are a number of simplifications done as part of changing the SenderState, particularly in the RubyTest.
Diffstat (limited to 'src/mem/bridge.cc')
-rw-r--r--src/mem/bridge.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mem/bridge.cc b/src/mem/bridge.cc
index bece5e6a1..bfe7e795c 100644
--- a/src/mem/bridge.cc
+++ b/src/mem/bridge.cc
@@ -201,8 +201,7 @@ Bridge::BridgeMasterPort::schedTimingReq(PacketPtr pkt, Tick when)
if (!pkt->memInhibitAsserted() && pkt->needsResponse()) {
// Update the sender state so we can deal with the response
// appropriately
- RequestState *req_state = new RequestState(pkt);
- pkt->senderState = req_state;
+ pkt->pushSenderState(new RequestState(pkt->getSrc()));
}
// If we're about to put this packet at the head of the queue, we
@@ -225,11 +224,10 @@ Bridge::BridgeSlavePort::schedTimingResp(PacketPtr pkt, Tick when)
// This is a response for a request we forwarded earlier. The
// corresponding request state should be stored in the packet's
// senderState field.
- RequestState *req_state = dynamic_cast<RequestState*>(pkt->senderState);
+ RequestState *req_state =
+ dynamic_cast<RequestState*>(pkt->popSenderState());
assert(req_state != NULL);
- // set up new packet dest & senderState based on values saved
- // from original request
- req_state->fixResponse(pkt);
+ pkt->setDest(req_state->origSrc);
delete req_state;
// the bridge assumes that at least one bus has set the