summaryrefslogtreecommitdiff
path: root/src/mem/port.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-04-25 10:41:23 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-04-25 10:41:23 -0400
commit4c92708b48d51bfb6592ff48925f5a7a0157da5b (patch)
tree2535fb1529ef60f64a3f26f943af5d8d681b22d8 /src/mem/port.cc
parent79750fc575db0966ff9d0530975377c35f630eca (diff)
downloadgem5-4c92708b48d51bfb6592ff48925f5a7a0157da5b.tar.xz
MEM: Add the PortId type and a corresponding id field to Port
This patch introduces the PortId type, moves the definition of INVALID_PORT_ID to the Port class, and also gives every port an id to reflect the fact that each element in a vector port has an identifier/index. Previously the bus and Ruby testers (and potentially other users of the vector ports) added the id field in their port subclasses, and now this functionality is always present as it is moved to the base class.
Diffstat (limited to 'src/mem/port.cc')
-rw-r--r--src/mem/port.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mem/port.cc b/src/mem/port.cc
index 4b7b040cb..fc3a42c02 100644
--- a/src/mem/port.cc
+++ b/src/mem/port.cc
@@ -50,8 +50,8 @@
#include "mem/mem_object.hh"
#include "mem/port.hh"
-Port::Port(const std::string &_name, MemObject& _owner)
- : portName(_name), peer(NULL), owner(_owner)
+Port::Port(const std::string &_name, MemObject& _owner, PortId _id)
+ : portName(_name), id(_id), peer(NULL), owner(_owner)
{
}
@@ -62,8 +62,8 @@ Port::~Port()
/**
* Master port
*/
-MasterPort::MasterPort(const std::string& name, MemObject* owner)
- : Port(name, *owner), _slavePort(NULL)
+MasterPort::MasterPort(const std::string& name, MemObject* owner, PortId _id)
+ : Port(name, *owner, _id), _slavePort(NULL)
{
}
@@ -130,8 +130,8 @@ MasterPort::printAddr(Addr a)
/**
* Slave port
*/
-SlavePort::SlavePort(const std::string& name, MemObject* owner)
- : Port(name, *owner), _masterPort(NULL)
+SlavePort::SlavePort(const std::string& name, MemObject* owner, PortId id)
+ : Port(name, *owner, id), _masterPort(NULL)
{
}