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/cpu/testers/rubytest/RubyTester.hh | |
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/cpu/testers/rubytest/RubyTester.hh')
-rw-r--r-- | src/cpu/testers/rubytest/RubyTester.hh | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/cpu/testers/rubytest/RubyTester.hh b/src/cpu/testers/rubytest/RubyTester.hh index 2fed84e2d..df1bc1fbb 100644 --- a/src/cpu/testers/rubytest/RubyTester.hh +++ b/src/cpu/testers/rubytest/RubyTester.hh @@ -1,4 +1,16 @@ /* + * Copyright (c) 2013 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood * Copyright (c) 2009 Advanced Micro Devices, Inc. * All rights reserved. @@ -69,20 +81,10 @@ class RubyTester : public MemObject struct SenderState : public Packet::SenderState { - SubBlock* subBlock; - Packet::SenderState *saved; - - SenderState(Address addr, int size, - Packet::SenderState *sender_state = NULL) - : saved(sender_state) - { - subBlock = new SubBlock(addr, size); - } - - ~SenderState() - { - delete subBlock; - } + SubBlock subBlock; + + SenderState(Address addr, int size) : subBlock(addr, size) {} + }; typedef RubyTesterParams Params; |