diff options
author | Nathan Binkert <nate@binkert.org> | 2007-07-23 21:51:38 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2007-07-23 21:51:38 -0700 |
commit | abc76f20cb98c90e8dab416dd16dfd4a954013ba (patch) | |
tree | f3131e68a09c1b4537e17df5b14df21df53746e4 /src/sim/system.cc | |
parent | 552097b92e37fb4c0fd27960afe0a03c02894f11 (diff) | |
download | gem5-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/system.cc')
-rw-r--r-- | src/sim/system.cc | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc index 2d0eaaf5b..3c4746e93 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -40,12 +40,13 @@ #include "cpu/thread_context.hh" #include "mem/mem_object.hh" #include "mem/physical.hh" -#include "sim/builder.hh" #include "sim/byteswap.hh" #include "sim/system.hh" #if FULL_SYSTEM #include "arch/vtophys.hh" #include "kern/kernel_stats.hh" +#else +#include "params/System.hh" #endif using namespace std; @@ -90,14 +91,14 @@ System::System(Params *p) /** * Load the kernel code into memory */ - if (params()->kernel_path == "") { + if (params()->kernel == "") { warn("No kernel set for full system simulation. Assuming you know what" " you're doing...\n"); } else { // Load kernel code - kernel = createObjectFile(params()->kernel_path); + kernel = createObjectFile(params()->kernel); if (kernel == NULL) - fatal("Could not load kernel file %s", params()->kernel_path); + fatal("Could not load kernel file %s", params()->kernel); // Load program sections into memory kernel->loadSections(&functionalPort, LoadAddrMask); @@ -146,7 +147,7 @@ int rgdb_wait = -1; int rgdb_enable = true; void -System::setMemoryMode(MemoryMode mode) +System::setMemoryMode(Enums::MemoryMode mode) { assert(getState() == Drained); memoryMode = mode; @@ -269,39 +270,16 @@ printSystems() const char *System::MemoryModeStrings[3] = {"invalid", "atomic", "timing"}; -#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<PhysicalMemory *> physmem; - SimpleEnumParam<System::MemoryMode> mem_mode; - -END_DECLARE_SIM_OBJECT_PARAMS(System) - -BEGIN_INIT_SIM_OBJECT_PARAMS(System) - - INIT_PARAM(physmem, "physical memory"), - INIT_ENUM_PARAM(mem_mode, "Memory Mode, (1=atomic, 2=timing)", - System::MemoryModeStrings) - -END_INIT_SIM_OBJECT_PARAMS(System) +#if !FULL_SYSTEM -CREATE_SIM_OBJECT(System) +System * +SystemParams::create() { System::Params *p = new System::Params; - p->name = getInstanceName(); + p->name = name; p->physmem = physmem; p->mem_mode = mem_mode; return new System(p); } -REGISTER_SIM_OBJECT("System", System) - #endif |