diff options
author | Nathan Binkert <binkertn@umich.edu> | 2007-01-28 10:26:59 -0800 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2007-01-28 10:26:59 -0800 |
commit | 37795b104d93a48b319074fbef770d88820d554a (patch) | |
tree | adb7bdddc656a667ecb84609caebd2a86defb2ee /src/dev/sparc | |
parent | f9a341f8e7871135e52d208c65185c96c1e51de5 (diff) | |
download | gem5-37795b104d93a48b319074fbef770d88820d554a.tar.xz |
Stick the conversion of python to unix time with all of
the other param code so that other functions can use it
as well.
--HG--
extra : convert_revision : a8becdeadc70af0b64bff5b0770788dfba6e1857
Diffstat (limited to 'src/dev/sparc')
-rw-r--r-- | src/dev/sparc/dtod.cc | 10 | ||||
-rw-r--r-- | src/dev/sparc/dtod.hh | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/dev/sparc/dtod.cc b/src/dev/sparc/dtod.cc index 30c7baaf5..50e158c12 100644 --- a/src/dev/sparc/dtod.cc +++ b/src/dev/sparc/dtod.cc @@ -49,12 +49,14 @@ using namespace std; using namespace TheISA; DumbTOD::DumbTOD(Params *p) - : BasicPioDevice(p), todTime(p->init_time) + : BasicPioDevice(p) { pioSize = 0x08; struct tm tm; - gmtime_r((time_t*)&todTime, &tm); + parseTime(p->init_time, &tm); + todTime = timegm(&tm); + DPRINTFN("Real-time clock set to %s\n", asctime(&tm)); DPRINTFN("Real-time clock set to %d\n", todTime); } @@ -86,7 +88,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(DumbTOD) Param<Tick> pio_latency; SimObjectParam<Platform *> platform; SimObjectParam<System *> system; - Param<time_t> time; + VectorParam<int> time; END_DECLARE_SIM_OBJECT_PARAMS(DumbTOD) @@ -96,7 +98,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DumbTOD) INIT_PARAM(pio_latency, "Programmed IO latency"), INIT_PARAM(platform, "platform"), INIT_PARAM(system, "system object"), - INIT_PARAM(time, "System time to use (0 for actual time") + INIT_PARAM(time, "") END_INIT_SIM_OBJECT_PARAMS(DumbTOD) diff --git a/src/dev/sparc/dtod.hh b/src/dev/sparc/dtod.hh index 7d3a9f628..26d4ecc08 100644 --- a/src/dev/sparc/dtod.hh +++ b/src/dev/sparc/dtod.hh @@ -36,6 +36,8 @@ #ifndef __DEV_SPARC_DTOD_HH__ #define __DEV_SPARC_DTOD_HH__ +#include <vector> + #include "base/range.hh" #include "dev/io_device.hh" @@ -52,7 +54,7 @@ class DumbTOD : public BasicPioDevice public: struct Params : public BasicPioDevice::Params { - time_t init_time; + std::vector<int> init_time; }; protected: const Params *params() const { return (const Params *)_params; } |