summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-02-22 18:09:11 -0500
committerNathan Binkert <binkertn@umich.edu>2004-02-22 18:09:11 -0500
commitbc5ed80b32c703fb86ead2dbd525b7c6323e563f (patch)
tree3db4f0c9f9c738db43e235c98830d7305b0c6acd /dev
parente067bc751bd13d73dfb0abe31f296140e3e29de9 (diff)
downloadgem5-bc5ed80b32c703fb86ead2dbd525b7c6323e563f.tar.xz
configurable latency for programmed IO
fix serialization dev/etherlink.cc: fix serialization --HG-- extra : convert_revision : 6739001f3f97b745d9874bb4c5729cc4909625c2
Diffstat (limited to 'dev')
-rw-r--r--dev/etherlink.cc38
1 files changed, 21 insertions, 17 deletions
diff --git a/dev/etherlink.cc b/dev/etherlink.cc
index 7c70b82ce..6396d758d 100644
--- a/dev/etherlink.cc
+++ b/dev/etherlink.cc
@@ -88,15 +88,17 @@ EtherLink::Link::Link(const std::string &name, double rate, EtherDump *d)
void
EtherLink::serialize(ostream &os)
{
+ nameOut(os, name() + ".link1");
link1->serialize(os);
+ nameOut(os, name() + ".link2");
link2->serialize(os);
}
void
EtherLink::unserialize(Checkpoint *cp, const string &section)
{
- link1->unserialize(cp, section);
- link2->unserialize(cp, section);
+ link1->unserialize(cp, section + ".link1");
+ link2->unserialize(cp, section + ".link2");
}
void
@@ -139,36 +141,38 @@ EtherLink::Link::transmit(PacketPtr &pkt)
void
EtherLink::Link::serialize(ostream &os)
{
- bool packetExists = false;
- if (packet) packetExists = true;
- SERIALIZE_SCALAR(packetExists);
- if (packetExists) {
- nameOut(os, csprintf("%s.linkPacket", name()));
- packet->serialize(os);
- }
+ bool packet_exists = packet;
+ SERIALIZE_SCALAR(packet_exists);
bool event_scheduled = event.scheduled();
SERIALIZE_SCALAR(event_scheduled);
if (event_scheduled) {
- SERIALIZE_SCALAR(event.when());
+ Tick event_time = event.when();
+ SERIALIZE_SCALAR(event_time);
+ }
+
+ if (packet_exists) {
+ nameOut(os, csprintf("%s.packet", name()));
+ packet->serialize(os);
}
}
void
EtherLink::Link::unserialize(Checkpoint *cp, const string &section)
{
- bool event_scheduled, packetExists;
- Tick eventTime;
- UNSERIALIZE_SCALAR(packetExists);
- if (packetExists) {
+ bool packet_exists;
+ UNSERIALIZE_SCALAR(packet_exists);
+ if (packet_exists) {
packet = new EtherPacket;
- packet->unserialize(cp, csprintf("%s.linkPacket", section));
+ packet->unserialize(cp, csprintf("%s.packet", section));
}
+ bool event_scheduled;
UNSERIALIZE_SCALAR(event_scheduled);
if (event_scheduled) {
- UNSERIALIZE_SCALAR(eventTime);
- event.schedule(eventTime);
+ Tick event_time;
+ UNSERIALIZE_SCALAR(event_time);
+ event.schedule(event_time);
}
}