diff options
author | Nathan Binkert <binkertn@umich.edu> | 2007-01-03 10:12:55 -0800 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2007-01-03 10:12:55 -0800 |
commit | fc45d42d01fba4f858012740e6a8a43ce5ecad9b (patch) | |
tree | 8f2e15b9f90416aaeb09d6398f91e6396934b57d /src/dev/alpha | |
parent | 7d7f3d0e99eca98a5659e73bce56d615f0ed4fc3 (diff) | |
download | gem5-fc45d42d01fba4f858012740e6a8a43ce5ecad9b.tar.xz |
Add 'Time' as a parameter type that can accept various
formats for time (strings, datetime objects, etc.)
Advance system time to 1/1/2009
Clean up time management code a little bit
--HG--
extra : convert_revision : 28ebecc7ea6b12f4345c77a9a6b4bdf2e752c4f8
Diffstat (limited to 'src/dev/alpha')
-rw-r--r-- | src/dev/alpha/tsunami_io.cc | 11 | ||||
-rw-r--r-- | src/dev/alpha/tsunami_io.hh | 5 |
2 files changed, 4 insertions, 12 deletions
diff --git a/src/dev/alpha/tsunami_io.cc b/src/dev/alpha/tsunami_io.cc index 8430856ef..38986b77e 100644 --- a/src/dev/alpha/tsunami_io.cc +++ b/src/dev/alpha/tsunami_io.cc @@ -57,17 +57,13 @@ using namespace std; //Should this be AlphaISA? using namespace TheISA; -TsunamiIO::RTC::RTC(const string &name, Tsunami* t, Tick i) - : _name(name), event(t, i), addr(0) +TsunamiIO::RTC::RTC(const string &n, Tsunami* tsunami, time_t t, Tick i) + : _name(n), event(tsunami, i), addr(0) { memset(clock_data, 0, sizeof(clock_data)); stat_regA = RTCA_32768HZ | RTCA_1024HZ; stat_regB = RTCB_PRDC_IE |RTCB_BIN | RTCB_24HR; -} -void -TsunamiIO::RTC::set_time(time_t t) -{ struct tm tm; gmtime_r(&t, &tm); @@ -428,7 +424,7 @@ TsunamiIO::PITimer::Counter::CounterEvent::description() TsunamiIO::TsunamiIO(Params *p) : BasicPioDevice(p), tsunami(p->tsunami), pitimer(p->name + "pitimer"), - rtc(p->name + ".rtc", p->tsunami, p->frequency) + rtc(p->name + ".rtc", p->tsunami, p->init_time, p->frequency) { pioSize = 0x100; @@ -436,7 +432,6 @@ TsunamiIO::TsunamiIO(Params *p) tsunami->io = this; timerData = 0; - rtc.set_time(p->init_time == 0 ? time(NULL) : p->init_time); picr = 0; picInterrupting = false; } diff --git a/src/dev/alpha/tsunami_io.hh b/src/dev/alpha/tsunami_io.hh index 54acefc25..b0c368eb8 100644 --- a/src/dev/alpha/tsunami_io.hh +++ b/src/dev/alpha/tsunami_io.hh @@ -110,10 +110,7 @@ class TsunamiIO : public BasicPioDevice uint8_t stat_regB; public: - RTC(const std::string &name, Tsunami* t, Tick i); - - /** Set the initial RTC time/date */ - void set_time(time_t t); + RTC(const std::string &name, Tsunami* tsunami, time_t t, Tick i); /** RTC address port: write address of RTC RAM data to access */ void writeAddr(const uint8_t data); |