Compiles now (with CPU_MODELS=SimpleCPU), but hangs
authorSteve Reinhardt <stever@eecs.umich.edu>
Fri, 10 Mar 2006 15:01:29 +0000 (10:01 -0500)
committerSteve Reinhardt <stever@eecs.umich.edu>
Fri, 10 Mar 2006 15:01:29 +0000 (10:01 -0500)
on execution.

configs/test/test.py:
    Move test binary out of m5-test, don't depend on
    m5-test/Benchmarks.
python/m5/objects/System.py:
    Split out full-system-only parameters (lost in merge).
sim/system.cc:
    Need to be able to instantiate System directly in SE mode
    (lost in merge).
sim/system.hh:
    A few more functions here are FS-only.
configs/test/hello:
    Add in binary.

--HG--
rename : configs/test.py => configs/test/test.py
extra : convert_revision : 4051b18772e0a0dcb97eb591d4373683be9f4395

configs/test.py [deleted file]
configs/test/hello [new file with mode: 0755]
configs/test/test.py [new file with mode: 0644]
python/m5/objects/System.py
sim/system.cc
sim/system.hh

diff --git a/configs/test.py b/configs/test.py
deleted file mode 100644 (file)
index ea0e63a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-from m5 import *
-AddToPath('/z/stever/bk/m5-test')
-import Benchmarks
-
-mem = PhysicalMemory()
-cpu = SimpleCPU(workload=Benchmarks.HelloWorld(), mem=mem)
-system = System(physmem=mem, cpu=cpu)
-root = Root(system=system)
diff --git a/configs/test/hello b/configs/test/hello
new file mode 100755 (executable)
index 0000000..59c0d19
Binary files /dev/null and b/configs/test/hello differ
diff --git a/configs/test/test.py b/configs/test/test.py
new file mode 100644 (file)
index 0000000..0982ba4
--- /dev/null
@@ -0,0 +1,10 @@
+from m5 import *
+
+class HelloWorld(LiveProcess):
+    executable = '../configs/test/hello'
+    cmd = 'hello'
+
+mem = PhysicalMemory()
+cpu = SimpleCPU(workload=HelloWorld(), mem=mem)
+system = System(physmem=mem, cpu=cpu)
+root = Root(system=system)
index 5925cadf56f9347a389a6bdec9fc8292cba774dc..2959c1d1a52aa8747de0db85814f4ddbb5c5949a 100644 (file)
@@ -2,15 +2,16 @@ from m5 import *
 
 class System(SimObject):
     type = 'System'
-    boot_cpu_frequency = Param.Frequency(Self.cpu[0].clock.frequency,
-                                         "boot processor frequency")
-    memctrl = Param.MemoryController(Parent.any, "memory controller")
     physmem = Param.PhysicalMemory(Parent.any, "phsyical memory")
-    init_param = Param.UInt64(0, "numerical value to pass into simulator")
-    bin = Param.Bool(False, "is this system binned")
-    binned_fns = VectorParam.String([], "functions broken down and binned")
-    kernel = Param.String("file that contains the kernel code")
-    readfile = Param.String("", "file to read startup script from")
+    if build_env['FULL_SYSTEM']:
+        boot_cpu_frequency = Param.Frequency(Self.cpu[0].clock.frequency,
+                                             "boot processor frequency")
+        memctrl = Param.MemoryController(Parent.any, "memory controller")
+        init_param = Param.UInt64(0, "numerical value to pass into simulator")
+        bin = Param.Bool(False, "is this system binned")
+        binned_fns = VectorParam.String([], "functions broken down and binned")
+        kernel = Param.String("file that contains the kernel code")
+        readfile = Param.String("", "file to read startup script from")
 
 class AlphaSystem(System):
     type = 'AlphaSystem'
index f1d0579d7ccd85107a0443c70fe5d0f00f41f374..05b41e32b56ae6822e3bbde277f7ce7b2efeb377 100644 (file)
@@ -217,5 +217,35 @@ printSystems()
     System::printSystems();
 }
 
+#if FULL_SYSTEM
+
+// In full system mode, only derived classes (e.g. AlphaLinuxSystem)
+// can be created directly.
+
 DEFINE_SIM_OBJECT_CLASS_NAME("System", System)
 
+#else
+
+BEGIN_DECLARE_SIM_OBJECT_PARAMS(System)
+
+    SimObjectParam<Memory *> physmem;
+
+END_DECLARE_SIM_OBJECT_PARAMS(System)
+
+BEGIN_INIT_SIM_OBJECT_PARAMS(System)
+
+    INIT_PARAM(physmem, "physical memory")
+
+END_INIT_SIM_OBJECT_PARAMS(System)
+
+CREATE_SIM_OBJECT(System)
+{
+    System::Params *p = new System::Params;
+    p->name = getInstanceName();
+    p->physmem = physmem;
+    return new System(p);
+}
+
+REGISTER_SIM_OBJECT("System", System)
+
+#endif
index cbe876c42e7b5944ee6c9f3b386de1b271bdb92f..0d5b40e3d21c7238a04bd4de46c6d7e5bf387c22 100644 (file)
@@ -101,6 +101,7 @@ class System : public SimObject
 
   protected:
 
+#if FULL_SYSTEM
     /**
      * Fix up an address used to match PCs for hooking simulator
      * events on to target function executions.  See comment in
@@ -125,7 +126,6 @@ class System : public SimObject
         return NULL;
     }
 
-#if FULL_SYSTEM
     /** Add a function-based event to kernel code. */
     template <class T>
     T *System::addKernelFuncEvent(const char *lbl)