summaryrefslogtreecommitdiff
path: root/sim/sim_object.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-03-15 17:11:54 -0500
committerNathan Binkert <binkertn@umich.edu>2005-03-15 17:11:54 -0500
commit0f8067fbf6106a197212859543ba865b396e75d4 (patch)
treea11d1fa407296267452f1e2d3c79aadb1b0b5a43 /sim/sim_object.cc
parent7d49146ea7d98c7586cb760f7e052fb1df923b55 (diff)
downloadgem5-0f8067fbf6106a197212859543ba865b396e75d4.tar.xz
Hard code the SimObject::Params struct
sim/sim_object.cc: Add a new constructor that can take the params struct and tweak the old one to create a params struct if we use the old constructor. sim/sim_object.hh: Hard code a Params struct for SimObject that all other params structs can derive from. Move the name string into the struct and update the code accordingly. New constructor that takes the params struct. --HG-- extra : convert_revision : 30761dab31d7257f9e8c864dcd6cae37309163f2
Diffstat (limited to 'sim/sim_object.cc')
-rw-r--r--sim/sim_object.cc19
1 files changed, 17 insertions, 2 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);
}