summaryrefslogtreecommitdiff
path: root/src/cpu/testers/rubytest/RubyTester.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/rubytest/RubyTester.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/rubytest/RubyTester.cc')
-rw-r--r--src/cpu/testers/rubytest/RubyTester.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cpu/testers/rubytest/RubyTester.cc b/src/cpu/testers/rubytest/RubyTester.cc
index 67f4c372a..1e9827515 100644
--- a/src/cpu/testers/rubytest/RubyTester.cc
+++ b/src/cpu/testers/rubytest/RubyTester.cc
@@ -75,13 +75,11 @@ RubyTester::RubyTester(const Params *p)
//
for (int i = 0; i < p->port_cpuInstPort_connection_count; ++i) {
readPorts.push_back(new CpuPort(csprintf("%s-instPort%d", name(), i),
- this, i,
- RubyTester::CpuPort::InstOnly));
+ this, i));
}
for (int i = 0; i < p->port_cpuDataPort_connection_count; ++i) {
- CpuPort *port = NULL;
- port = new CpuPort(csprintf("%s-dataPort%d", name(), i), this, i,
- RubyTester::CpuPort::DataOnly);
+ CpuPort *port = new CpuPort(csprintf("%s-dataPort%d", name(), i),
+ this, i);
readPorts.push_back(port);
writePorts.push_back(port);
}
@@ -168,6 +166,12 @@ RubyTester::CpuPort::recvTiming(PacketPtr pkt)
return true;
}
+bool
+RubyTester::isInstReadableCpuPort(int idx)
+{
+ return idx < m_num_inst_ports;
+}
+
MasterPort*
RubyTester::getReadableCpuPort(int idx)
{