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/dev/sparc/dtod.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/dev/sparc/dtod.cc')
-rw-r--r-- | src/dev/sparc/dtod.cc | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/src/dev/sparc/dtod.cc b/src/dev/sparc/dtod.cc index 42275c60a..7e948085e 100644 --- a/src/dev/sparc/dtod.cc +++ b/src/dev/sparc/dtod.cc @@ -37,26 +37,25 @@ #include <string> #include <vector> +#include "base/time.hh" #include "base/trace.hh" #include "dev/sparc/dtod.hh" #include "dev/platform.hh" #include "mem/packet_access.hh" #include "mem/port.hh" -#include "sim/builder.hh" #include "sim/system.hh" using namespace std; using namespace TheISA; -DumbTOD::DumbTOD(Params *p) +DumbTOD::DumbTOD(const Params *p) : BasicPioDevice(p) { - struct tm tm; + struct tm tm = p->time; char *tz; pioSize = 0x08; - parseTime(p->init_time, &tm); tz = getenv("TZ"); setenv("TZ", "", 1); tzset(); @@ -104,37 +103,8 @@ DumbTOD::unserialize(Checkpoint *cp, const std::string §ion) UNSERIALIZE_SCALAR(todTime); } - -BEGIN_DECLARE_SIM_OBJECT_PARAMS(DumbTOD) - - Param<Addr> pio_addr; - Param<Tick> pio_latency; - SimObjectParam<Platform *> platform; - SimObjectParam<System *> system; - VectorParam<int> time; - -END_DECLARE_SIM_OBJECT_PARAMS(DumbTOD) - -BEGIN_INIT_SIM_OBJECT_PARAMS(DumbTOD) - - INIT_PARAM(pio_addr, "Device Address"), - INIT_PARAM(pio_latency, "Programmed IO latency"), - INIT_PARAM(platform, "platform"), - INIT_PARAM(system, "system object"), - INIT_PARAM(time, "") - -END_INIT_SIM_OBJECT_PARAMS(DumbTOD) - -CREATE_SIM_OBJECT(DumbTOD) +DumbTOD * +DumbTODParams::create() { - DumbTOD::Params *p = new DumbTOD::Params; - p->name =getInstanceName(); - p->pio_addr = pio_addr; - p->pio_delay = pio_latency; - p->platform = platform; - p->system = system; - p->init_time = time; - return new DumbTOD(p); + return new DumbTOD(this); } - -REGISTER_SIM_OBJECT("DumbTOD", DumbTOD) |