summaryrefslogtreecommitdiff
path: root/src/mem/port.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-03-06 21:37:01 -0800
committerGabe Black <gabeblack@google.com>2019-03-15 18:37:02 +0000
commita73069c87dab6d32d5de021d37e009a93cd50cac (patch)
tree9962d8c6e3dd15dfff8c819fca625399694f0819 /src/mem/port.hh
parentb5046b2e512ccf3ffdbba85b169b1adcba6c4443 (diff)
downloadgem5-a73069c87dab6d32d5de021d37e009a93cd50cac.tar.xz
mem: Track the MemObject owner in MasterPort and SlavePort.
These types are much more tied to MemObjects and the gem5 memory protocol than the Port or BaseMasterPort and BaseSlavePort classes. Change-Id: I36bc8c75b9c74d28ee8b65dbcbf742cd41135742 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17032 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/mem/port.hh')
-rw-r--r--src/mem/port.hh28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/mem/port.hh b/src/mem/port.hh
index 39f6dead8..2c30e31d1 100644
--- a/src/mem/port.hh
+++ b/src/mem/port.hh
@@ -76,17 +76,13 @@ class Port
*/
const PortID id;
- /** A reference to the MemObject that owns this port. */
- MemObject& owner;
-
/**
* Abstract base class for ports
*
* @param _name Port name including the owners name
- * @param _owner The MemObject that is the structural owner of this port
* @param _id A port identifier for vector ports
*/
- Port(const std::string& _name, MemObject& _owner, PortID _id);
+ Port(const std::string& _name, PortID _id);
/**
* Virtual destructor due to inheritance.
@@ -119,8 +115,7 @@ class BaseMasterPort : public Port
BaseSlavePort* _baseSlavePort;
- BaseMasterPort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ BaseMasterPort(const std::string& name, PortID id=InvalidPortID);
virtual ~BaseMasterPort();
public:
@@ -143,8 +138,7 @@ class BaseSlavePort : public Port
BaseMasterPort* _baseMasterPort;
- BaseSlavePort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ BaseSlavePort(const std::string& name, PortID id=InvalidPortID);
virtual ~BaseSlavePort();
public:
@@ -173,10 +167,14 @@ class MasterPort : public BaseMasterPort
SlavePort* _slavePort;
+ protected:
+
+ MemObject& owner;
+
public:
- MasterPort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ MasterPort(const std::string& name, MemObject* _owner,
+ PortID id=InvalidPortID);
virtual ~MasterPort();
/**
@@ -350,10 +348,14 @@ class SlavePort : public BaseSlavePort
MasterPort* _masterPort;
+ protected:
+
+ MemObject& owner;
+
public:
- SlavePort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ SlavePort(const std::string& name, MemObject* _owner,
+ PortID id=InvalidPortID);
virtual ~SlavePort();
/**