summaryrefslogtreecommitdiff
path: root/src/cpu/testers/rubytest/Check.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/cpu/testers/rubytest/Check.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/cpu/testers/rubytest/Check.cc')
-rw-r--r--src/cpu/testers/rubytest/Check.cc24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/cpu/testers/rubytest/Check.cc b/src/cpu/testers/rubytest/Check.cc
index a861dbfd8..ae74da67f 100644
--- a/src/cpu/testers/rubytest/Check.cc
+++ b/src/cpu/testers/rubytest/Check.cc
@@ -111,16 +111,13 @@ Check::initiatePrefetch()
// push the subblock onto the sender state. The sequencer will
// update the subblock on the return
- pkt->senderState =
- new SenderState(m_address, req->getSize(), pkt->senderState);
+ pkt->senderState = new SenderState(m_address, req->getSize());
if (port->sendTimingReq(pkt)) {
DPRINTF(RubyTest, "successfully initiated prefetch.\n");
} else {
// If the packet did not issue, must delete
- SenderState* senderState = safe_cast<SenderState*>(pkt->senderState);
- pkt->senderState = senderState->saved;
- delete senderState;
+ delete pkt->senderState;
delete pkt->req;
delete pkt;
@@ -151,8 +148,7 @@ Check::initiateFlush()
// push the subblock onto the sender state. The sequencer will
// update the subblock on the return
- pkt->senderState =
- new SenderState(m_address, req->getSize(), pkt->senderState);
+ pkt->senderState = new SenderState(m_address, req->getSize());
if (port->sendTimingReq(pkt)) {
DPRINTF(RubyTest, "initiating Flush - successful\n");
@@ -198,8 +194,7 @@ Check::initiateAction()
// push the subblock onto the sender state. The sequencer will
// update the subblock on the return
- pkt->senderState =
- new SenderState(writeAddr, req->getSize(), pkt->senderState);
+ pkt->senderState = new SenderState(writeAddr, req->getSize());
if (port->sendTimingReq(pkt)) {
DPRINTF(RubyTest, "initiating action - successful\n");
@@ -210,9 +205,7 @@ Check::initiateAction()
// If the packet did not issue, must delete
// Note: No need to delete the data, the packet destructor
// will delete it
- SenderState* senderState = safe_cast<SenderState*>(pkt->senderState);
- pkt->senderState = senderState->saved;
- delete senderState;
+ delete pkt->senderState;
delete pkt->req;
delete pkt;
@@ -250,8 +243,7 @@ Check::initiateCheck()
// push the subblock onto the sender state. The sequencer will
// update the subblock on the return
- pkt->senderState =
- new SenderState(m_address, req->getSize(), pkt->senderState);
+ pkt->senderState = new SenderState(m_address, req->getSize());
if (port->sendTimingReq(pkt)) {
DPRINTF(RubyTest, "initiating check - successful\n");
@@ -262,9 +254,7 @@ Check::initiateCheck()
// If the packet did not issue, must delete
// Note: No need to delete the data, the packet destructor
// will delete it
- SenderState* senderState = safe_cast<SenderState*>(pkt->senderState);
- pkt->senderState = senderState->saved;
- delete senderState;
+ delete pkt->senderState;
delete pkt->req;
delete pkt;