summaryrefslogtreecommitdiff
path: root/dev/etherlink.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-03-05 05:50:33 -0500
committerNathan Binkert <binkertn@umich.edu>2004-03-05 05:50:33 -0500
commit01f493a28ad8a85b0796058f8e032c90f3c4ac5d (patch)
tree66caf008ceb5f580aa0d087741fc735df997a99e /dev/etherlink.hh
parent1a300ef60da887fd3e90add708af4344e19770cb (diff)
parenta57bc93e82ac074204a32011a2c756ad1daedad5 (diff)
downloadgem5-01f493a28ad8a85b0796058f8e032c90f3c4ac5d.tar.xz
Merge zizzer.eecs.umich.edu:/bk/m5
into ziff.eecs.umich.edu:/z/binkertn/research/m5/latest --HG-- extra : convert_revision : 51b3fd809a77e146b8370636b2cc60ddf1075195
Diffstat (limited to 'dev/etherlink.hh')
-rw-r--r--dev/etherlink.hh31
1 files changed, 12 insertions, 19 deletions
diff --git a/dev/etherlink.hh b/dev/etherlink.hh
index 8505570a6..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; }
@@ -123,7 +116,7 @@ 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);