From 0622f30961fc32b967bb1ef784afc5a205b16f6e Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 19 Feb 2013 05:56:05 -0500 Subject: 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. --- src/mem/bridge.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mem/bridge.cc') 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(pkt->senderState); + RequestState *req_state = + dynamic_cast(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 -- cgit v1.2.3