BaseSystem -> System
authorNathan Binkert <binkertn@umich.edu>
Sat, 4 Jun 2005 18:19:05 +0000 (14:19 -0400)
committerNathan Binkert <binkertn@umich.edu>
Sat, 4 Jun 2005 18:19:05 +0000 (14:19 -0400)
Make System an object that can be instantiated.  For operating
systems that don't need any OS specific hacks.

python/m5/objects/AlphaConsole.py:
python/m5/objects/BaseCPU.py:
python/m5/objects/Tsunami.py:
    BaseSystem -> System

--HG--
rename : python/m5/objects/BaseSystem.py => python/m5/objects/System.py
extra : convert_revision : e5d12db02abef1b0eda720b50dd2c09cb1ac5232

python/m5/objects/AlphaConsole.py
python/m5/objects/BaseCPU.py
python/m5/objects/BaseSystem.py [deleted file]
python/m5/objects/System.py [new file with mode: 0644]
python/m5/objects/Tsunami.py
sim/system.cc

index 9fe31b009bc2f52c8458e6f7b37c23c3536f6a97..32a137bec71206b5caf0ea5febb07144c7cdabd1 100644 (file)
@@ -7,4 +7,4 @@ class AlphaConsole(PioDevice):
     disk = Param.SimpleDisk("Simple Disk")
     num_cpus = Param.Int(1, "Number of CPUs")
     sim_console = Param.SimConsole(Parent.any, "The Simulator Console")
-    system = Param.BaseSystem(Parent.any, "system object")
+    system = Param.System(Parent.any, "system object")
index 0dc43643482565c6f235554b22fb8d81bf4b3502..452b97c84776e0bdaa3018c0deb4c4dfc819fda3 100644 (file)
@@ -9,7 +9,7 @@ class BaseCPU(SimObject):
         dtb = Param.AlphaDTB("Data TLB")
         itb = Param.AlphaITB("Instruction TLB")
         mem = Param.FunctionalMemory("memory")
-        system = Param.BaseSystem(Parent.any, "system object")
+        system = Param.System(Parent.any, "system object")
     else:
         workload = VectorParam.Process("processes to run")
 
diff --git a/python/m5/objects/BaseSystem.py b/python/m5/objects/BaseSystem.py
deleted file mode 100644 (file)
index 457eadb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-from m5 import *
-class BaseSystem(SimObject):
-    type = 'BaseSystem'
-    abstract = True
-    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")
-    kernel = Param.String("file that contains the kernel code")
-    console = Param.String("file that contains the console code")
-    pal = Param.String("file that contains palcode")
-    readfile = Param.String("", "file to read startup script from")
-    init_param = Param.UInt64(0, "numerical value to pass into simulator")
-    boot_osflags = Param.String("a", "boot flags to pass to the kernel")
-    system_type = Param.UInt64("Type of system we are emulating")
-    system_rev = Param.UInt64("Revision of system we are emulating")
-    bin = Param.Bool(False, "is this system binned")
-    binned_fns = VectorParam.String([], "functions broken down and binned")
diff --git a/python/m5/objects/System.py b/python/m5/objects/System.py
new file mode 100644 (file)
index 0000000..c247983
--- /dev/null
@@ -0,0 +1,17 @@
+from m5 import *
+class System(SimObject):
+    type = 'BaseSystem'
+    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")
+    kernel = Param.String("file that contains the kernel code")
+    console = Param.String("file that contains the console code")
+    pal = Param.String("file that contains palcode")
+    readfile = Param.String("", "file to read startup script from")
+    init_param = Param.UInt64(0, "numerical value to pass into simulator")
+    boot_osflags = Param.String("a", "boot flags to pass to the kernel")
+    system_type = Param.UInt64("Type of system we are emulating")
+    system_rev = Param.UInt64("Revision of system we are emulating")
+    bin = Param.Bool(False, "is this system binned")
+    binned_fns = VectorParam.String([], "functions broken down and binned")
index fa3c18127a4778d0daf07596dc351e8bfd58d7bb..c8fd94e2cfd1b9e8414a9b213753842cd436978c 100644 (file)
@@ -5,7 +5,7 @@ from Platform import Platform
 class Tsunami(Platform):
     type = 'Tsunami'
     pciconfig = Param.PciConfigAll("PCI configuration")
-    system = Param.BaseSystem(Parent.any, "system")
+    system = Param.System(Parent.any, "system")
 
 class TsunamiCChip(FooPioDevice):
     type = 'TsunamiCChip'
index c6a65f9d9afdf09cfafcf53a4c8a41e7dbca70e6..8844f13deb1d7bdaf8bb166a0e7ea95077b543bd 100644 (file)
@@ -34,7 +34,7 @@
 #include "mem/functional_mem/memory_control.hh"
 #include "mem/functional_mem/physical_memory.hh"
 #include "targetarch/vtophys.hh"
-#include "sim/param.hh"
+#include "sim/builder.hh"
 #include "sim/system.hh"
 #include "base/trace.hh"
 
@@ -269,5 +269,69 @@ printSystems()
     System::printSystems();
 }
 
-DEFINE_SIM_OBJECT_CLASS_NAME("System", System)
+BEGIN_DECLARE_SIM_OBJECT_PARAMS(System)
+
+    Param<Tick> boot_cpu_frequency;
+    SimObjectParam<MemoryController *> memctrl;
+    SimObjectParam<PhysicalMemory *> physmem;
+
+    Param<string> kernel;
+    Param<string> console;
+    Param<string> pal;
+
+    Param<string> boot_osflags;
+    Param<string> readfile;
+    Param<unsigned int> init_param;
+
+    Param<uint64_t> system_type;
+    Param<uint64_t> system_rev;
+
+    Param<bool> bin;
+    VectorParam<string> binned_fns;
+    Param<bool> bin_int;
+
+END_DECLARE_SIM_OBJECT_PARAMS(System)
+
+BEGIN_INIT_SIM_OBJECT_PARAMS(System)
+
+    INIT_PARAM(boot_cpu_frequency, "Frequency of the boot CPU"),
+    INIT_PARAM(memctrl, "memory controller"),
+    INIT_PARAM(physmem, "phsyical memory"),
+    INIT_PARAM(kernel, "file that contains the kernel code"),
+    INIT_PARAM(console, "file that contains the console code"),
+    INIT_PARAM(pal, "file that contains palcode"),
+    INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot",
+                    "a"),
+    INIT_PARAM_DFLT(readfile, "file to read startup script from", ""),
+    INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0),
+    INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34),
+    INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10),
+    INIT_PARAM_DFLT(bin, "is this system to be binned", false),
+    INIT_PARAM(binned_fns, "functions to be broken down and binned"),
+    INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", true)
+
+END_INIT_SIM_OBJECT_PARAMS(System)
+
+CREATE_SIM_OBJECT(System)
+{
+    System::Params *p = new System::Params;
+    p->name = getInstanceName();
+    p->boot_cpu_frequency = boot_cpu_frequency;
+    p->memctrl = memctrl;
+    p->physmem = physmem;
+    p->kernel_path = kernel;
+    p->console_path = console;
+    p->palcode = pal;
+    p->boot_osflags = boot_osflags;
+    p->init_param = init_param;
+    p->readfile = readfile;
+    p->system_type = system_type;
+    p->system_rev = system_rev;
+    p->bin = bin;
+    p->binned_fns = binned_fns;
+    p->bin_int = bin_int;
+    return new System(p);
+}
+
+REGISTER_SIM_OBJECT("System", System)