From 4c92708b48d51bfb6592ff48925f5a7a0157da5b Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Wed, 25 Apr 2012 10:41:23 -0400 Subject: 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. --- src/mem/port.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mem/port.cc') 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) { } -- cgit v1.2.3