summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-05-30 05:29:42 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-05-30 05:29:42 -0400
commitcad802761a876c6dcd00d58e09c8984886c987f6 (patch)
treefcb327a8923631de61133c6ad14aeaffcc44761c /src/cpu
parent6a54f7fc5ff1c33bc9f222014dc08c33248b0299 (diff)
downloadgem5-cad802761a876c6dcd00d58e09c8984886c987f6.tar.xz
Packet: Unify the use of PortID in packet and port
This patch removes the Packet::NodeID typedef and unifies it with the Port::PortId. The src and dest fields in the packet are used to hold a port id (e.g. in the bus), and thus the two should actually be the same. The typedef PortID is now global (in base/types.hh) and aligned with the ThreadID in terms of capitalisation and naming of the InvalidPortID constant. Before this patch, two flags were used for valid destination and source, rather than relying on a named value (InvalidPortID), and this is now redundant, as the src and dest field themselves are sufficient to tell whether the current value is a valid port identifier or not. Consequently, the VALID_SRC and VALID_DST are removed. As part of the cleaning up, a number of int parameters and local variables are updated to use PortID. Note that Ruby still has its own NodeID typedef. Furthermore, the MemObject getMaster/SlavePort still has an int idx parameter with a default value of -1 which should eventually change to PortID idx = InvalidPortID.
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/testers/directedtest/RubyDirectedTester.hh2
-rw-r--r--src/cpu/testers/rubytest/RubyTester.hh2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/testers/directedtest/RubyDirectedTester.hh b/src/cpu/testers/directedtest/RubyDirectedTester.hh
index 75e72edf8..325c60447 100644
--- a/src/cpu/testers/directedtest/RubyDirectedTester.hh
+++ b/src/cpu/testers/directedtest/RubyDirectedTester.hh
@@ -54,7 +54,7 @@ class RubyDirectedTester : public MemObject
public:
CpuPort(const std::string &_name, RubyDirectedTester *_tester,
- Port::PortId _id)
+ PortID _id)
: MasterPort(_name, _tester, _id), tester(_tester)
{}
diff --git a/src/cpu/testers/rubytest/RubyTester.hh b/src/cpu/testers/rubytest/RubyTester.hh
index 8fbd886b3..ad4b506ac 100644
--- a/src/cpu/testers/rubytest/RubyTester.hh
+++ b/src/cpu/testers/rubytest/RubyTester.hh
@@ -57,7 +57,7 @@ class RubyTester : public MemObject
// RubyPorts that support both types of requests, separate InstOnly
// and DataOnly CpuPorts will map to that RubyPort
- CpuPort(const std::string &_name, RubyTester *_tester, PortId _id)
+ CpuPort(const std::string &_name, RubyTester *_tester, PortID _id)
: MasterPort(_name, _tester, _id), tester(_tester)
{}