Major changes to how SimObjects are created and initialized. Almost all
[gem5.git] / src / sim / root.cc
index f4743af0a49d2b2151f231de19ad688699f09b32..15f73b15bed2c386c22321a38e805570a1505d94 100644 (file)
 #include <vector>
 
 #include "base/misc.hh"
-#include "sim/builder.hh"
+#include "params/Root.hh"
 #include "sim/sim_object.hh"
 
 // Dummy Object
 struct Root : public SimObject
 {
-    Root(const std::string &name) : SimObject(name) {}
+    Root(RootParams *params) : SimObject(params) {}
 };
 
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(Root)
-
-    Param<int> dummy; // needed below
-
-END_DECLARE_SIM_OBJECT_PARAMS(Root)
-
-BEGIN_INIT_SIM_OBJECT_PARAMS(Root)
-
-    INIT_PARAM(dummy, "")  // All SimObjects must have params
-
-END_INIT_SIM_OBJECT_PARAMS(Root)
-
-CREATE_SIM_OBJECT(Root)
+Root *
+RootParams::create()
 {
     static bool created = false;
     if (created)
@@ -65,7 +54,5 @@ CREATE_SIM_OBJECT(Root)
 
     created = true;
 
-    return  new Root(getInstanceName());
+    return new Root(this);
 }
-
-REGISTER_SIM_OBJECT("Root", Root)