diff options
author | Lisa Hsu <hsul@eecs.umich.edu> | 2004-03-11 18:52:29 -0500 |
---|---|---|
committer | Lisa Hsu <hsul@eecs.umich.edu> | 2004-03-11 18:52:29 -0500 |
commit | 3bc8cffc75c2e03a6a8fe5f4425940a16405f672 (patch) | |
tree | 1d44dba1a7dbd4aef6fad45753b7607928d3414a /dev/etherlink.hh | |
parent | 1039028d408d5a374a67d8d3ecc640a0e6559fbb (diff) | |
parent | 2c60d7aa9e4b48f30ab8c48436ff2dfec8e390f2 (diff) | |
download | gem5-3bc8cffc75c2e03a6a8fe5f4425940a16405f672.tar.xz |
merge with m5 head
--HG--
extra : convert_revision : c90339248d1ee74df1c6b90a77ec9ea41f646311
Diffstat (limited to 'dev/etherlink.hh')
-rw-r--r-- | dev/etherlink.hh | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/dev/etherlink.hh b/dev/etherlink.hh index e1a7957ee..3b1dd21bc 100644 --- a/dev/etherlink.hh +++ b/dev/etherlink.hh @@ -49,6 +49,7 @@ class EtherLink : public SimObject protected: class Interface; + friend class LinkDelayEvent; /* * Model for a single uni-directional link */ @@ -59,34 +60,26 @@ class EtherLink : public SimObject Interface *txint; Interface *rxint; - double ticks_per_byte; + double ticksPerByte; + Tick linkDelay; EtherDump *dump; protected: /* * Transfer is complete */ - class DoneEvent : public Event - { - protected: - Link *link; - - public: - DoneEvent(EventQueue *q, Link *l) - : Event(q), link(l) {} - virtual void process() { link->txDone(); } - virtual const char *description() - { return "ethernet link completion"; } - }; - - friend class DoneEvent; - DoneEvent event; PacketPtr packet; - void txDone(); + typedef EventWrapper<Link, &Link::txDone> DoneEvent; + friend class DoneEvent; + DoneEvent doneEvent; + + friend class LinkDelayEvent; + void txComplete(PacketPtr &packet); public: - Link(const std::string &name, double rate, EtherDump *dump); + Link(const std::string &name, double rate, Tick delay, + EtherDump *dump); ~Link() {} virtual const std::string name() const { return objName; } @@ -96,6 +89,9 @@ class EtherLink : public SimObject void setTxInt(Interface *i) { assert(!txint); txint = i; } void setRxInt(Interface *i) { assert(!rxint); rxint = i; } + + virtual void serialize(std::ostream &os); + virtual void unserialize(Checkpoint *cp, const std::string §ion); }; /* @@ -120,8 +116,12 @@ class EtherLink : public SimObject public: EtherLink(const std::string &name, EtherInt *i1, EtherInt *i2, - Tick speed, EtherDump *dump); + Tick speed, Tick delay, EtherDump *dump); virtual ~EtherLink(); + + virtual void serialize(std::ostream &os); + virtual void unserialize(Checkpoint *cp, const std::string §ion); + }; #endif // __ETHERLINK_HH__ |