diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2013-02-19 05:56:05 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2013-02-19 05:56:05 -0500 |
commit | 0622f30961fc32b967bb1ef784afc5a205b16f6e (patch) | |
tree | b6b57cf049b7fc7e49cc65a735af7508862b9c24 /src/mem/bridge.cc | |
parent | f69d431ede9b815ea4b63a2d20237ed3e79df169 (diff) | |
download | gem5-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.cc | 10 |
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 |