summaryrefslogtreecommitdiff
path: root/src/cpu/testers/rubytest/RubyTester.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/RubyTester.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/RubyTester.cc')
-rw-r--r--src/cpu/testers/rubytest/RubyTester.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/cpu/testers/rubytest/RubyTester.cc b/src/cpu/testers/rubytest/RubyTester.cc
index 085647533..68f76f1a6 100644
--- a/src/cpu/testers/rubytest/RubyTester.cc
+++ b/src/cpu/testers/rubytest/RubyTester.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 ARM Limited
+ * Copyright (c) 2012-2013 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -149,17 +149,13 @@ RubyTester::CpuPort::recvTimingResp(PacketPtr pkt)
// retrieve the subblock and call hitCallback
RubyTester::SenderState* senderState =
safe_cast<RubyTester::SenderState*>(pkt->senderState);
- SubBlock* subblock = senderState->subBlock;
- assert(subblock != NULL);
+ SubBlock& subblock = senderState->subBlock;
- // pop the sender state from the packet
- pkt->senderState = senderState->saved;
-
- tester->hitCallback(id, subblock);
+ tester->hitCallback(id, &subblock);
// Now that the tester has completed, delete the senderState
// (includes sublock) and the packet, then return
- delete senderState;
+ delete pkt->senderState;
delete pkt->req;
delete pkt;
return true;