summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorLisa Hsu <hsul@eecs.umich.edu>2005-03-16 10:49:42 -0500
committerLisa Hsu <hsul@eecs.umich.edu>2005-03-16 10:49:42 -0500
commitbc6baa4049c285322fd0601a88c352fda1996dc1 (patch)
treea25c84a48af9185b06f5166ac386f8cedcdf3e3d /sim
parent650306d5e5119e54190ce342e0b7afc182cd3c08 (diff)
parentd80522183992207132e638ce2bb02513758bb61f (diff)
downloadgem5-bc6baa4049c285322fd0601a88c352fda1996dc1.tar.xz
Merge zizzer:/bk/m5
into zizzer.eecs.umich.edu:/.automount/zed/z/hsul/work/m5/pact05 --HG-- extra : convert_revision : e7ff23f6ac4e434d8b3117275df12fec03964a55
Diffstat (limited to 'sim')
-rw-r--r--sim/sim_object.cc19
-rw-r--r--sim/sim_object.hh17
2 files changed, 28 insertions, 8 deletions
diff --git a/sim/sim_object.cc b/sim/sim_object.cc
index 818648b98..559415102 100644
--- a/sim/sim_object.cc
+++ b/sim/sim_object.cc
@@ -61,14 +61,29 @@ namespace Stats {
//
// SimObject constructor: used to maintain static simObjectList
//
+SimObject::SimObject(Params *p)
+ : _params(p)
+{
+#ifdef DEBUG
+ doDebugBreak = false;
+#endif
+
+ doRecordEvent = !Stats::event_ignore.match(name());
+ simObjectList.push_back(this);
+}
+
+//
+// SimObject constructor: used to maintain static simObjectList
+//
SimObject::SimObject(const string &_name)
- : objName(_name)
+ : _params(new Params)
{
+ _params->name = _name;
#ifdef DEBUG
doDebugBreak = false;
#endif
- doRecordEvent = !Stats::event_ignore.match(_name);
+ doRecordEvent = !Stats::event_ignore.match(name());
simObjectList.push_back(this);
}
diff --git a/sim/sim_object.hh b/sim/sim_object.hh
index b8a3090ad..db8d4f4d3 100644
--- a/sim/sim_object.hh
+++ b/sim/sim_object.hh
@@ -48,8 +48,16 @@
*/
class SimObject : public Serializable, protected StartupCallback
{
+ public:
+ struct Params {
+ std::string name;
+ };
+
protected:
- std::string objName;
+ Params *_params;
+
+ public:
+ const Params *params() const { return _params; }
private:
friend class Serializer;
@@ -60,15 +68,12 @@ class SimObject : public Serializable, protected StartupCallback
static SimObjectList simObjectList;
public:
-
-// for Params struct
-#include "simobj/param/SimObject.hh"
-
+ SimObject(Params *_params);
SimObject(const std::string &_name);
virtual ~SimObject() {}
- virtual const std::string name() const { return objName; }
+ virtual const std::string name() const { return params()->name; }
// initialization pass of all objects.
// Gets invoked after construction, before unserialize.