summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-10-16 15:56:53 -0400
committerGabe Black <gblack@eecs.umich.edu>2006-10-16 15:56:53 -0400
commit519d11bab32e0ec4cf73f3b1c80f0e77a43155d2 (patch)
treeb9bdd19e2f2aa2698da47d82615d4b5d864eb8cc /src/sim
parentf1661baf30faf76dbad7d23aeac0c3dbe4dd045c (diff)
parent9202422d6ebb7a17936bee1b9aaa427541156d13 (diff)
downloadgem5-519d11bab32e0ec4cf73f3b1c80f0e77a43155d2.tar.xz
Merge zizzer.eecs.umich.edu:/bk/newmem
into zeep.eecs.umich.edu:/home/gblack/m5/newmem --HG-- extra : convert_revision : 898976bbd322e55bc234035456df8090c6dcf72d
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/main.cc12
-rw-r--r--src/sim/sim_object.hh7
-rw-r--r--src/sim/system.hh14
3 files changed, 23 insertions, 10 deletions
diff --git a/src/sim/main.cc b/src/sim/main.cc
index 874d0ac85..8bb0d7aaa 100644
--- a/src/sim/main.cc
+++ b/src/sim/main.cc
@@ -66,6 +66,7 @@
#include "sim/sim_events.hh"
#include "sim/sim_exit.hh"
#include "sim/sim_object.hh"
+#include "sim/system.hh"
#include "sim/stat_control.hh"
#include "sim/stats.hh"
#include "sim/root.hh"
@@ -440,6 +441,17 @@ convertToBaseCPUPtr(SimObject *obj)
return ptr;
}
+System *
+convertToSystemPtr(SimObject *obj)
+{
+ System *ptr = dynamic_cast<System *>(obj);
+
+ if (ptr == NULL)
+ warn("Casting to System pointer failed");
+ return ptr;
+}
+
+
/**
* Do C++ simulator exit processing. Exported to SWIG to be invoked
* when simulator terminates via Python's atexit mechanism.
diff --git a/src/sim/sim_object.hh b/src/sim/sim_object.hh
index 38f2bdd23..32807b69d 100644
--- a/src/sim/sim_object.hh
+++ b/src/sim/sim_object.hh
@@ -64,6 +64,13 @@ class SimObject : public Serializable, protected StartupCallback
Draining,
Drained
};
+
+ enum MemoryMode {
+ Invalid=0,
+ Atomic,
+ Timing
+ };
+
private:
State state;
diff --git a/src/sim/system.hh b/src/sim/system.hh
index 3ab1d81f2..827fe5c78 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -62,22 +62,16 @@ class RemoteGDB;
class System : public SimObject
{
public:
- enum MemoryMode {
- Invalid=0,
- Atomic,
- Timing
- };
static const char *MemoryModeStrings[3];
-
- MemoryMode getMemoryMode() { assert(memoryMode); return memoryMode; }
+ SimObject::MemoryMode getMemoryMode() { assert(memoryMode); return memoryMode; }
/** Change the memory mode of the system. This should only be called by the
* python!!
* @param mode Mode to change to (atomic/timing)
*/
- void setMemoryMode(MemoryMode mode);
+ void setMemoryMode(SimObject::MemoryMode mode);
PhysicalMemory *physmem;
PCEventQueue pcEventQueue;
@@ -126,7 +120,7 @@ class System : public SimObject
protected:
- MemoryMode memoryMode;
+ SimObject::MemoryMode memoryMode;
#if FULL_SYSTEM
/**
@@ -173,7 +167,7 @@ class System : public SimObject
{
std::string name;
PhysicalMemory *physmem;
- MemoryMode mem_mode;
+ SimObject::MemoryMode mem_mode;
#if FULL_SYSTEM
Tick boot_cpu_frequency;