summaryrefslogtreecommitdiff
path: root/src/cpu/testers/directedtest/InvalidateGenerator.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-04-14 05:46:59 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-04-14 05:46:59 -0400
commit14edc6013d8d62782d58536214c669e12c64da37 (patch)
tree639d9ed2d37086bad6eb9576a4cfcc02729860e5 /src/cpu/testers/directedtest/InvalidateGenerator.cc
parent750f33a90194f3f827ef887fb7e151235e61c919 (diff)
downloadgem5-14edc6013d8d62782d58536214c669e12c64da37.tar.xz
Ruby: Use MasterPort base-class pointers where possible
This patch simplifies future patches by changing the pointer type used in a number of the Ruby testers to use MasterPort instead of using a derived CpuPort class. There is no reason for using the more specialised pointers, and there is no longer a need to do any casting. With the latest changes to the tester, organising ports as readers and writes, things got a bit more complicated, and the "type" now had to be removed to be able to fall back to using MasterPort rather than CpuPort.
Diffstat (limited to 'src/cpu/testers/directedtest/InvalidateGenerator.cc')
-rw-r--r--src/cpu/testers/directedtest/InvalidateGenerator.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cpu/testers/directedtest/InvalidateGenerator.cc b/src/cpu/testers/directedtest/InvalidateGenerator.cc
index 4c248ea05..a89853061 100644
--- a/src/cpu/testers/directedtest/InvalidateGenerator.cc
+++ b/src/cpu/testers/directedtest/InvalidateGenerator.cc
@@ -52,7 +52,7 @@ InvalidateGenerator::~InvalidateGenerator()
bool
InvalidateGenerator::initiate()
{
- RubyDirectedTester::CpuPort* port;
+ MasterPort* port;
Request::Flags flags;
PacketPtr pkt;
Packet::Command cmd;
@@ -66,14 +66,12 @@ InvalidateGenerator::initiate()
if (m_status == InvalidateGeneratorStatus_Load_Waiting) {
DPRINTF(DirectedTest, "initiating read\n");
cmd = MemCmd::ReadReq;
- port = safe_cast<RubyDirectedTester::CpuPort*>(m_directed_tester->
- getCpuPort(m_active_read_node));
+ port = m_directed_tester->getCpuPort(m_active_read_node);
pkt = new Packet(req, cmd);
} else if (m_status == InvalidateGeneratorStatus_Inv_Waiting) {
DPRINTF(DirectedTest, "initiating invalidating write\n");
cmd = MemCmd::WriteReq;
- port = safe_cast<RubyDirectedTester::CpuPort*>(m_directed_tester->
- getCpuPort(m_active_inv_node));
+ port = m_directed_tester->getCpuPort(m_active_inv_node);
pkt = new Packet(req, cmd);
} else {
panic("initiate was unexpectedly called\n");