added serializeation code

--HG--
extra : convert_revision : 468f3c739707d167af43562695b604fd7dead661
This commit is contained in:
Ali Saidi 2004-02-11 15:32:30 -05:00
parent f7c4d57260
commit 0f34a00703
4 changed files with 64 additions and 7 deletions

View file

@ -279,13 +279,23 @@ TsunamiCChip::clearDRIR(uint64_t bitvector)
void void
TsunamiCChip::serialize(std::ostream &os) TsunamiCChip::serialize(std::ostream &os)
{ {
// code should be written SERIALIZE_ARRAY(dim, Tsunami::Max_CPUs);
SERIALIZE_ARRAY(dir, Tsunami::Max_CPUs);
SERIALIZE_ARRAY(dirInterrupting, Tsunami::Max_CPUs);
SERIALIZE_SCALAR(drir);
SERIALIZE_SCALAR(misc);
SERIALIZE_SCALAR(RTCInterrupting);
} }
void void
TsunamiCChip::unserialize(Checkpoint *cp, const std::string &section) TsunamiCChip::unserialize(Checkpoint *cp, const std::string &section)
{ {
//code should be written UNSERIALIZE_ARRAY(dim, Tsunami::Max_CPUs);
UNSERIALIZE_ARRAY(dir, Tsunami::Max_CPUs);
UNSERIALIZE_ARRAY(dirInterrupting, Tsunami::Max_CPUs);
UNSERIALIZE_SCALAR(drir);
UNSERIALIZE_SCALAR(misc);
UNSERIALIZE_SCALAR(RTCInterrupting);
} }
BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiCChip) BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiCChip)

View file

@ -346,13 +346,35 @@ TsunamiIO::clearPIC(uint8_t bitvector)
void void
TsunamiIO::serialize(std::ostream &os) TsunamiIO::serialize(std::ostream &os)
{ {
// code should be written SERIALIZE_SCALAR(timerData);
SERIALIZE_SCALAR(uip);
SERIALIZE_SCALAR(picr);
SERIALIZE_SCALAR(picInterrupting);
Tick time0when = timer0.when();
Tick time2when = timer2.when();
Tick rtcwhen = rtc.when();
SERIALIZE_SCALAR(time0when);
SERIALIZE_SCALAR(time2when);
SERIALIZE_SCALAR(rtcwhen);
} }
void void
TsunamiIO::unserialize(Checkpoint *cp, const std::string &section) TsunamiIO::unserialize(Checkpoint *cp, const std::string &section)
{ {
//code should be written UNSERIALIZE_SCALAR(timerData);
UNSERIALIZE_SCALAR(uip);
UNSERIALIZE_SCALAR(picr);
UNSERIALIZE_SCALAR(picInterrupting);
Tick time0when;
Tick time2when;
Tick rtcwhen;
UNSERIALIZE_SCALAR(time0when);
UNSERIALIZE_SCALAR(time2when);
UNSERIALIZE_SCALAR(rtcwhen);
timer0.reschedule(time0when);
timer2.reschedule(time2when);
rtc.reschedule(rtcwhen);
} }
BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiIO) BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiIO)

View file

@ -227,13 +227,37 @@ TsunamiPChip::write(MemReqPtr &req, const uint8_t *data)
void void
TsunamiPChip::serialize(std::ostream &os) TsunamiPChip::serialize(std::ostream &os)
{ {
// code should be written SERIALIZE_SCALAR(wsba0);
SERIALIZE_SCALAR(wsba1);
SERIALIZE_SCALAR(wsba2);
SERIALIZE_SCALAR(wsba3);
SERIALIZE_SCALAR(wsm0);
SERIALIZE_SCALAR(wsm1);
SERIALIZE_SCALAR(wsm2);
SERIALIZE_SCALAR(wsm3);
SERIALIZE_SCALAR(tba0);
SERIALIZE_SCALAR(tba1);
SERIALIZE_SCALAR(tba2);
SERIALIZE_SCALAR(tba3);
} }
void void
TsunamiPChip::unserialize(Checkpoint *cp, const std::string &section) TsunamiPChip::unserialize(Checkpoint *cp, const std::string &section)
{ {
//code should be written UNSERIALIZE_SCALAR(wsba0);
UNSERIALIZE_SCALAR(wsba1);
UNSERIALIZE_SCALAR(wsba2);
UNSERIALIZE_SCALAR(wsba3);
UNSERIALIZE_SCALAR(wsm0);
UNSERIALIZE_SCALAR(wsm1);
UNSERIALIZE_SCALAR(wsm2);
UNSERIALIZE_SCALAR(wsm3);
UNSERIALIZE_SCALAR(tba0);
UNSERIALIZE_SCALAR(tba1);
UNSERIALIZE_SCALAR(tba2);
UNSERIALIZE_SCALAR(tba3);
} }
BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiPChip) BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiPChip)

View file

@ -117,7 +117,6 @@ TsunamiUart::read(MemReqPtr &req, uint8_t *data)
*data = 0; *data = 0;
return No_Fault; return No_Fault;
case 0xA: case 0xA:
//*data = 2<<6; // This means a 8250 serial port, do we want a 16550?
*data = 0; // This means a 8250 serial port, do we want a 16550? *data = 0; // This means a 8250 serial port, do we want a 16550?
return No_Fault; return No_Fault;
} }
@ -183,6 +182,7 @@ TsunamiUart::serialize(ostream &os)
SERIALIZE_SCALAR(status_store); SERIALIZE_SCALAR(status_store);
SERIALIZE_SCALAR(next_char); SERIALIZE_SCALAR(next_char);
SERIALIZE_SCALAR(valid_char); SERIALIZE_SCALAR(valid_char);
SERIALIZE_SCALAR(IER);
} }
void void
@ -191,6 +191,7 @@ TsunamiUart::unserialize(Checkpoint *cp, const std::string &section)
UNSERIALIZE_SCALAR(status_store); UNSERIALIZE_SCALAR(status_store);
UNSERIALIZE_SCALAR(next_char); UNSERIALIZE_SCALAR(next_char);
UNSERIALIZE_SCALAR(valid_char); UNSERIALIZE_SCALAR(valid_char);
UNSERIALIZE_SCALAR(IER);
} }
BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiUart) BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiUart)