sim: Make SimObject inherit from Named
Standardize name creation of sim objects. Change-Id: I5e0cb828da0810b47217e96e302857e32083c50b Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43246 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
committed by
Daniel Carvalho
parent
bac49a04b5
commit
a906e04cb7
@@ -917,12 +917,6 @@ ElasticTrace::TraceInfo::typeToStr() const
|
||||
return Record::RecordType_Name(type);
|
||||
}
|
||||
|
||||
const std::string
|
||||
ElasticTrace::name() const
|
||||
{
|
||||
return ProbeListenerObject::name();
|
||||
}
|
||||
|
||||
void
|
||||
ElasticTrace::flushTraces()
|
||||
{
|
||||
|
||||
@@ -109,9 +109,6 @@ class ElasticTrace : public ProbeListenerObject
|
||||
/** 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.
|
||||
|
||||
@@ -63,8 +63,7 @@ class SimpleTrace : public ProbeListenerObject
|
||||
/** 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";
|
||||
|
||||
@@ -54,7 +54,7 @@ SimObjectResolver *SimObject::_objNameResolver = NULL;
|
||||
//
|
||||
SimObject::SimObject(const Params &p)
|
||||
: EventManager(getEventQueue(p.eventq_index)),
|
||||
statistics::Group(nullptr),
|
||||
statistics::Group(nullptr), Named(p.name),
|
||||
_params(p)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -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 @@ class SimObjectResolver;
|
||||
* \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 @@ class SimObject : public EventManager, public Serializable, public Drainable,
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user