Merge zizzer:/bk/newmem
[gem5.git] / src / sim / system.hh
index 65cb0c95cc5c6038e319b2a5405d24b1bb3714b7..b3a67bf7a74d8fbcd4f717896257de7d450f3344 100644 (file)
@@ -39,6 +39,7 @@
 #include "base/loader/symtab.hh"
 #include "base/misc.hh"
 #include "base/statistics.hh"
+#include "config/full_system.hh"
 #include "cpu/pc_event.hh"
 #include "mem/port.hh"
 #include "sim/sim_object.hh"
 #endif
 
 class BaseCPU;
-class ExecContext;
+class ThreadContext;
 class ObjectFile;
 class PhysicalMemory;
 
 #if FULL_SYSTEM
 class Platform;
 class GDBListener;
-class RemoteGDB;
-namespace Kernel { class Binning; }
+namespace TheISA
+{
+    class RemoteGDB;
+}
 #endif
 
 class System : public SimObject
 {
   public:
+
+    static const char *MemoryModeStrings[3];
+
+    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(SimObject::MemoryMode mode);
+
     PhysicalMemory *physmem;
     PCEventQueue pcEventQueue;
 
-    std::vector<ExecContext *> execContexts;
+    std::vector<ThreadContext *> threadContexts;
     int numcpus;
 
     int getNumCPUs()
     {
-        if (numcpus != execContexts.size())
+        if (numcpus != threadContexts.size())
             panic("cpu array not fully populated!");
 
         return numcpus;
@@ -100,8 +114,6 @@ class System : public SimObject
     /** Entry point in the kernel to start at */
     Addr kernelEntry;
 
-    Kernel::Binning *kernelBinning;
-
 #else
 
     int page_ptr;
@@ -111,6 +123,8 @@ class System : public SimObject
 
   protected:
 
+    SimObject::MemoryMode memoryMode;
+
 #if FULL_SYSTEM
     /**
      * Fix up an address used to match PCs for hooking simulator
@@ -124,7 +138,7 @@ class System : public SimObject
      * up in the specified symbol table.
      */
     template <class T>
-    T *System::addFuncEvent(SymbolTable *symtab, const char *lbl)
+    T *addFuncEvent(SymbolTable *symtab, const char *lbl)
     {
         Addr addr = 0; // initialize only to avoid compiler warning
 
@@ -138,7 +152,7 @@ class System : public SimObject
 
     /** Add a function-based event to kernel code. */
     template <class T>
-    T *System::addKernelFuncEvent(const char *lbl)
+    T *addKernelFuncEvent(const char *lbl)
     {
         return addFuncEvent<T>(kernelSymtab, lbl);
     }
@@ -146,7 +160,7 @@ class System : public SimObject
 #endif
   public:
 #if FULL_SYSTEM
-    std::vector<RemoteGDB *> remoteGDB;
+    std::vector<TheISA::RemoteGDB *> remoteGDB;
     std::vector<GDBListener *> gdbListen;
     virtual bool breakpoint() = 0;
 #endif // FULL_SYSTEM
@@ -156,17 +170,16 @@ class System : public SimObject
     {
         std::string name;
         PhysicalMemory *physmem;
+        SimObject::MemoryMode mem_mode;
 
 #if FULL_SYSTEM
         Tick boot_cpu_frequency;
         std::string boot_osflags;
         uint64_t init_param;
-        bool bin;
-        std::vector<std::string> binned_fns;
-        bool bin_int;
 
         std::string kernel_path;
         std::string readfile;
+        std::string symbolfile;
 #endif
     };
 
@@ -208,10 +221,9 @@ class System : public SimObject
 
 #endif // FULL_SYSTEM
 
-    int registerExecContext(ExecContext *xc, int xcIndex);
-    void replaceExecContext(ExecContext *xc, int xcIndex);
+    int registerThreadContext(ThreadContext *tc, int tcIndex);
+    void replaceThreadContext(ThreadContext *tc, int tcIndex);
 
-    void regStats();
     void serialize(std::ostream &os);
     void unserialize(Checkpoint *cp, const std::string &section);