summaryrefslogtreecommitdiff
path: root/src/sim/sim_object.hh
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2007-07-23 21:51:38 -0700
committerNathan Binkert <nate@binkert.org>2007-07-23 21:51:38 -0700
commitabc76f20cb98c90e8dab416dd16dfd4a954013ba (patch)
treef3131e68a09c1b4537e17df5b14df21df53746e4 /src/sim/sim_object.hh
parent552097b92e37fb4c0fd27960afe0a03c02894f11 (diff)
downloadgem5-abc76f20cb98c90e8dab416dd16dfd4a954013ba.tar.xz
Major changes to how SimObjects are created and initialized. Almost all
creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed
Diffstat (limited to 'src/sim/sim_object.hh')
-rw-r--r--src/sim/sim_object.hh23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/sim/sim_object.hh b/src/sim/sim_object.hh
index 536e761e5..2e99a85bf 100644
--- a/src/sim/sim_object.hh
+++ b/src/sim/sim_object.hh
@@ -41,6 +41,7 @@
#include <vector>
#include <iostream>
+#include "params/SimObject.hh"
#include "sim/serialize.hh"
#include "sim/startup.hh"
@@ -55,33 +56,19 @@ class Event;
class SimObject : public Serializable, protected StartupCallback
{
public:
- struct Params {
- std::string name;
- };
-
enum State {
Running,
Draining,
Drained
};
- enum MemoryMode {
- Invalid=0,
- Atomic,
- Timing
- };
-
private:
State state;
protected:
- Params *_params;
-
void changeState(State new_state) { state = new_state; }
public:
- const Params *params() const { return _params; }
-
State getState() { return state; }
private:
@@ -90,10 +77,14 @@ class SimObject : public Serializable, protected StartupCallback
// list of all instantiated simulation objects
static SimObjectList simObjectList;
+ protected:
+ const SimObjectParams *_params;
+
public:
- SimObject(Params *_params);
+ typedef SimObjectParams Params;
+ const Params *params() const { return _params; }
+ SimObject(const Params *_params);
SimObject(const std::string &_name);
-
virtual ~SimObject() {}
virtual const std::string name() const { return params()->name; }