Daniel Carvalho has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/43246 )

Change subject: sim: Make SimObject inherit from Named
......................................................................

sim: Make SimObject inherit from Named

Standardize name creation of sim objects.

Change-Id: I5e0cb828da0810b47217e96e302857e32083c50b
Signed-off-by: Daniel R. Carvalho <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43246
Tested-by: kokoro <[email protected]>
Reviewed-by: Giacomo Travaglini <[email protected]>
Maintainer: Giacomo Travaglini <[email protected]>
---
M src/cpu/o3/probe/elastic_trace.cc
M src/cpu/o3/probe/elastic_trace.hh
M src/cpu/o3/probe/simple_trace.hh
M src/sim/sim_object.cc
M src/sim/sim_object.hh
5 files changed, 4 insertions(+), 19 deletions(-)

Approvals:
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/cpu/o3/probe/elastic_trace.cc b/src/cpu/o3/probe/elastic_trace.cc
index 092c0cf..56816b0 100644
--- a/src/cpu/o3/probe/elastic_trace.cc
+++ b/src/cpu/o3/probe/elastic_trace.cc
@@ -917,12 +917,6 @@
     return Record::RecordType_Name(type);
 }

-const std::string
-ElasticTrace::name() const
-{
-    return ProbeListenerObject::name();
-}
-
 void
 ElasticTrace::flushTraces()
 {
diff --git a/src/cpu/o3/probe/elastic_trace.hh b/src/cpu/o3/probe/elastic_trace.hh
index 3a6af32..4dddcea 100644
--- a/src/cpu/o3/probe/elastic_trace.hh
+++ b/src/cpu/o3/probe/elastic_trace.hh
@@ -109,9 +109,6 @@
     /** Register all listeners. */
     void regEtraceListeners();

-    /** Returns the name of the trace probe listener. */
-    const std::string name() const;
-
     /**
* Process any outstanding trace records, flush them out to the protobuf
      * output streams and delete the streams at simulation exit.
diff --git a/src/cpu/o3/probe/simple_trace.hh b/src/cpu/o3/probe/simple_trace.hh
index 7ed9ede..7fc5565 100644
--- a/src/cpu/o3/probe/simple_trace.hh
+++ b/src/cpu/o3/probe/simple_trace.hh
@@ -63,8 +63,7 @@
     /** Register the probe listeners. */
     void regProbeListeners() override;

-    /** Returns the name of the trace. */
-    const std::string
+    std::string
     name() const override
     {
         return ProbeListenerObject::name() + ".trace";
diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc
index 949a990..f1f88a9 100644
--- a/src/sim/sim_object.cc
+++ b/src/sim/sim_object.cc
@@ -54,7 +54,7 @@
 //
 SimObject::SimObject(const Params &p)
     : EventManager(getEventQueue(p.eventq_index)),
-      statistics::Group(nullptr),
+      statistics::Group(nullptr), Named(p.name),
       _params(p)
 {
 #ifdef DEBUG
diff --git a/src/sim/sim_object.hh b/src/sim/sim_object.hh
index a47b0a3..cec2743 100644
--- a/src/sim/sim_object.hh
+++ b/src/sim/sim_object.hh
@@ -49,6 +49,7 @@
 #include <string>
 #include <vector>

+#include "base/named.hh"
 #include "base/stats/group.hh"
 #include "params/SimObject.hh"
 #include "sim/drain.hh"
@@ -140,7 +141,7 @@
  * \endcode
  */
class SimObject : public EventManager, public Serializable, public Drainable,
-                  public statistics::Group
+                  public statistics::Group, public Named
 {
   private:
     typedef std::vector<SimObject *> SimObjectList;
@@ -179,12 +180,6 @@
     virtual ~SimObject();

   public:
-
-    /**
-     * @ingroup api_simobject
-     */
-    virtual const std::string name() const { return params().name; }
-
     /**
      * init() is called after all C++ SimObjects have been created and
      * all ports are connected.  Initializations that are independent



9 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/43246
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I5e0cb828da0810b47217e96e302857e32083c50b
Gerrit-Change-Number: 43246
Gerrit-PatchSet: 11
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to