summaryrefslogtreecommitdiff
path: root/src/dev/alpha/tsunami_io.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2007-01-25 14:59:41 -0500
committerNathan Binkert <binkertn@umich.edu>2007-01-25 14:59:41 -0500
commit73dd0ea35716b90c8448d729273cc153888a223b (patch)
tree4b9e1477bcf945deb7268ddc9be2f150a8c29a6f /src/dev/alpha/tsunami_io.hh
parent4301e4cd08018eb56b4f196afcce9a8311f390b4 (diff)
downloadgem5-73dd0ea35716b90c8448d729273cc153888a223b.tar.xz
Instead of passing an int to represent time between python and C++
pass the tuple of python's struct_time and interpret that. Fixes a problem where the local timezone leaked into the time calculation. Also fix things so that the unix, python, and RTC data sheets all get the right time. Provide both years since 1900 and BCD two digit year. Put the date back at 1/1/2006 for now. --HG-- extra : convert_revision : 473244572f468de2cb579a3dd7ae296a6f81f5d7
Diffstat (limited to 'src/dev/alpha/tsunami_io.hh')
-rw-r--r--src/dev/alpha/tsunami_io.hh13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/dev/alpha/tsunami_io.hh b/src/dev/alpha/tsunami_io.hh
index b0c368eb8..f42af4197 100644
--- a/src/dev/alpha/tsunami_io.hh
+++ b/src/dev/alpha/tsunami_io.hh
@@ -85,6 +85,9 @@ class TsunamiIO : public BasicPioDevice
/** Current RTC register address/index */
int addr;
+ /** should the year be interpreted as BCD? */
+ bool year_is_bcd;
+
/** Data for real-time clock function */
union {
uint8_t clock_data[10];
@@ -110,7 +113,8 @@ class TsunamiIO : public BasicPioDevice
uint8_t stat_regB;
public:
- RTC(const std::string &name, Tsunami* tsunami, time_t t, Tick i);
+ RTC(const std::string &name, Tsunami* tsunami,
+ const std::vector<int> &t, bool bcd, Tick i);
/** RTC address port: write address of RTC RAM data to access */
void writeAddr(const uint8_t data);
@@ -121,6 +125,9 @@ class TsunamiIO : public BasicPioDevice
/** RTC read data */
uint8_t readData();
+ /** RTC get the date */
+ std::string getDateString();
+
/**
* Serialize this object to the given output stream.
* @param base The base name of the counter object.
@@ -313,8 +320,10 @@ class TsunamiIO : public BasicPioDevice
{
Tick frequency;
Tsunami *tsunami;
- time_t init_time;
+ std::vector<int> init_time;
+ bool year_is_bcd;
};
+
protected:
const Params *params() const { return (const Params*)_params; }