[gem5-dev] Change in gem5/gem5[master]: mem: Track the MemObject owner in MasterPort and SlavePort.

2019-03-15 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/17032 )


Change subject: mem: Track the MemObject owner in MasterPort and SlavePort.
..

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 
Reviewed-by: Nikos Nikoleris 
Maintainer: Gabe Black 
---
M src/mem/port.cc
M src/mem/port.hh
2 files changed, 25 insertions(+), 25 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, but someone else must approve
  Nikos Nikoleris: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/src/mem/port.cc b/src/mem/port.cc
index 47f56e6..ab62ccf 100644
--- a/src/mem/port.cc
+++ b/src/mem/port.cc
@@ -51,8 +51,8 @@
 #include "base/trace.hh"
 #include "mem/mem_object.hh"

-Port::Port(const std::string &_name, MemObject& _owner, PortID _id)
-: portName(_name), id(_id), owner(_owner)
+Port::Port(const std::string &_name, PortID _id)
+: portName(_name), id(_id)
 {
 }

@@ -60,9 +60,8 @@
 {
 }

-BaseMasterPort::BaseMasterPort(const std::string& name, MemObject* owner,
-   PortID _id)
-: Port(name, *owner, _id), _baseSlavePort(NULL)
+BaseMasterPort::BaseMasterPort(const std::string &name, PortID _id)
+: Port(name, _id), _baseSlavePort(NULL)
 {
 }

@@ -86,9 +85,8 @@
 return _baseSlavePort != NULL;
 }

-BaseSlavePort::BaseSlavePort(const std::string& name, MemObject* owner,
- PortID _id)
-: Port(name, *owner, _id), _baseMasterPort(NULL)
+BaseSlavePort::BaseSlavePort(const std::string &name, PortID _id)
+: Port(name, _id), _baseMasterPort(NULL)
 {
 }

@@ -115,8 +113,8 @@
 /**
  * Master port
  */
-MasterPort::MasterPort(const std::string& name, MemObject* owner, PortID  
_id)

-: BaseMasterPort(name, owner, _id), _slavePort(NULL)
+MasterPort::MasterPort(const std::string& name, MemObject* _owner, PortID  
_id)

+: BaseMasterPort(name, _id), _slavePort(NULL), owner(*_owner)
 {
 }

@@ -219,8 +217,8 @@
 /**
  * Slave port
  */
-SlavePort::SlavePort(const std::string& name, MemObject* owner, PortID id)
-: BaseSlavePort(name, owner, id), _masterPort(NULL)
+SlavePort::SlavePort(const std::string& name, MemObject* _owner, PortID id)
+: BaseSlavePort(name, id), _masterPort(NULL), owner(*_owner)
 {
 }

diff --git a/src/mem/port.hh b/src/mem/port.hh
index 39f6dea..2c30e31 100644
--- a/src/mem/port.hh
+++ b/src/mem/port.hh
@@ -76,17 +76,13 @@
  */
 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 @@

 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 @@

 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 @@

 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 @@

 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();

 /**

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17032
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I36bc8c75b9c74d28ee8b65dbcbf742cd41135742
Gerrit-Change-Number: 17032
Gerrit-PatchSet: 5
Gerrit-Owner: Gabe Black 
Gerrit-As

[gem5-dev] Change in gem5/gem5[master]: mem: Track the MemObject owner in MasterPort and SlavePort.

2019-03-14 Thread Gabe Black (Gerrit)

Hello Anthony Gutierrez, Jason Lowe-Power, Nikos Nikoleris, Weiping Liao,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/17032

to look at the new patch set (#3).

Change subject: mem: Track the MemObject owner in MasterPort and SlavePort.
..

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
---
M src/mem/port.cc
M src/mem/port.hh
2 files changed, 25 insertions(+), 25 deletions(-)


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17032
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I36bc8c75b9c74d28ee8b65dbcbf742cd41135742
Gerrit-Change-Number: 17032
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black 
Gerrit-Assignee: Nikos Nikoleris 
Gerrit-Reviewer: Anthony Gutierrez 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: Weiping Liao 
Gerrit-CC: Andreas Sandberg 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: mem: Track the MemObject owner in MasterPort and SlavePort.

2019-03-07 Thread Gabe Black (Gerrit)
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/17032



Change subject: mem: Track the MemObject owner in MasterPort and SlavePort.
..

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
---
M src/mem/port.cc
M src/mem/port.hh
2 files changed, 25 insertions(+), 24 deletions(-)



diff --git a/src/mem/port.cc b/src/mem/port.cc
index 47f56e6..ab62ccf 100644
--- a/src/mem/port.cc
+++ b/src/mem/port.cc
@@ -51,8 +51,8 @@
 #include "base/trace.hh"
 #include "mem/mem_object.hh"

-Port::Port(const std::string &_name, MemObject& _owner, PortID _id)
-: portName(_name), id(_id), owner(_owner)
+Port::Port(const std::string &_name, PortID _id)
+: portName(_name), id(_id)
 {
 }

@@ -60,9 +60,8 @@
 {
 }

-BaseMasterPort::BaseMasterPort(const std::string& name, MemObject* owner,
-   PortID _id)
-: Port(name, *owner, _id), _baseSlavePort(NULL)
+BaseMasterPort::BaseMasterPort(const std::string &name, PortID _id)
+: Port(name, _id), _baseSlavePort(NULL)
 {
 }

@@ -86,9 +85,8 @@
 return _baseSlavePort != NULL;
 }

-BaseSlavePort::BaseSlavePort(const std::string& name, MemObject* owner,
- PortID _id)
-: Port(name, *owner, _id), _baseMasterPort(NULL)
+BaseSlavePort::BaseSlavePort(const std::string &name, PortID _id)
+: Port(name, _id), _baseMasterPort(NULL)
 {
 }

@@ -115,8 +113,8 @@
 /**
  * Master port
  */
-MasterPort::MasterPort(const std::string& name, MemObject* owner, PortID  
_id)

-: BaseMasterPort(name, owner, _id), _slavePort(NULL)
+MasterPort::MasterPort(const std::string& name, MemObject* _owner, PortID  
_id)

+: BaseMasterPort(name, _id), _slavePort(NULL), owner(*_owner)
 {
 }

@@ -219,8 +217,8 @@
 /**
  * Slave port
  */
-SlavePort::SlavePort(const std::string& name, MemObject* owner, PortID id)
-: BaseSlavePort(name, owner, id), _masterPort(NULL)
+SlavePort::SlavePort(const std::string& name, MemObject* _owner, PortID id)
+: BaseSlavePort(name, id), _masterPort(NULL), owner(*_owner)
 {
 }

diff --git a/src/mem/port.hh b/src/mem/port.hh
index 39f6dea..c4cc4eb 100644
--- a/src/mem/port.hh
+++ b/src/mem/port.hh
@@ -76,9 +76,6 @@
  */
 const PortID id;

-/** A reference to the MemObject that owns this port. */
-MemObject& owner;
-
 /**
  * Abstract base class for ports
  *
@@ -86,7 +83,7 @@
  * @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 +116,7 @@

 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 +139,7 @@

 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 +168,14 @@

 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 +349,14 @@

 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();

 /**

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17032
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I36bc8c75b9c74d28ee8b65dbcbf742cd41135742
Gerrit-Change-Number: 17032
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
Gerrit-MessageType: newchange
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev