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/ruby/system/RubyPort.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/ruby/system/RubyPort.cc')
-rw-r--r-- | src/mem/ruby/system/RubyPort.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc index 2f1cc622d..5e9e8cdd4 100644 --- a/src/mem/ruby/system/RubyPort.cc +++ b/src/mem/ruby/system/RubyPort.cc @@ -151,12 +151,9 @@ RubyPort::PioPort::recvTimingResp(PacketPtr pkt) // First we must retrieve the request port from the sender State RubyPort::SenderState *senderState = - safe_cast<RubyPort::SenderState *>(pkt->senderState); + safe_cast<RubyPort::SenderState *>(pkt->popSenderState()); M5Port *port = senderState->port; assert(port != NULL); - - // pop the sender state from the packet - pkt->senderState = senderState->saved; delete senderState; port->sendTimingResp(pkt); @@ -187,7 +184,7 @@ RubyPort::M5Port::recvTimingReq(PacketPtr pkt) // Save the port in the sender state object to be used later to // route the response - pkt->senderState = new SenderState(this, pkt->senderState); + pkt->pushSenderState(new SenderState(this)); // Check for pio requests and directly send them to the dedicated // pio port. @@ -230,7 +227,7 @@ RubyPort::M5Port::recvTimingReq(PacketPtr pkt) pkt->getAddr(), RequestStatus_to_string(requestStatus)); SenderState* senderState = safe_cast<SenderState*>(pkt->senderState); - pkt->senderState = senderState->saved; + pkt->senderState = senderState->predecessor; delete senderState; return false; } @@ -305,7 +302,7 @@ RubyPort::ruby_hit_callback(PacketPtr pkt) assert(port != NULL); // pop the sender state from the packet - pkt->senderState = senderState->saved; + pkt->senderState = senderState->predecessor; delete senderState; port->hitCallback(pkt); |