Default jobfile for stats
[gem5.git] / dev / etherlink.hh
index d5cd7d7c823a459e4496857dfab6c99615ba5a22..b9e6047fc8266df8832d3c27a81bc79829b12581 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002-2004 The Regents of The University of Michigan
+ * Copyright (c) 2002-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@
 #include "sim/sim_object.hh"
 
 class EtherDump;
-
+class Checkpoint;
 /*
  * Model for a fixed bandwidth full duplex ethernet link
  */
@@ -53,10 +53,14 @@ class EtherLink : public SimObject
      /*
       * Model for a single uni-directional link
       */
-    class Link : public Serializable {
+    class Link
+    {
       protected:
         std::string objName;
 
+        EtherLink *parent;
+        int number;
+
         Interface *txint;
         Interface *rxint;
 
@@ -78,11 +82,11 @@ class EtherLink : public SimObject
         void txComplete(PacketPtr packet);
 
       public:
-        Link(const std::string &name, double rate, Tick delay,
-             EtherDump *dump);
+        Link(const std::string &name, EtherLink *p, int num,
+             double rate, Tick delay, EtherDump *dump);
         ~Link() {}
 
-        virtual const std::string name() const { return objName; }
+        const std::string name() const { return objName; }
 
         bool busy() const { return (bool)packet; }
         bool transmit(PacketPtr packet);
@@ -90,8 +94,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 &section);
+        void serialize(const std::string &base, std::ostream &os);
+        void unserialize(const std::string &base, Checkpoint *cp,
+                                 const std::string &section);
     };
 
     /*
@@ -108,15 +113,12 @@ class EtherLink : public SimObject
         void sendDone() { peer->sendDone(); }
     };
 
-    Link *link1;
-    Link *link2;
-
-    EtherInt *int1;
-    EtherInt *int2;
+    Link *link[2];
+    EtherInt *interface[2];
 
   public:
-    EtherLink(const std::string &name, EtherInt *i1, EtherInt *i2,
-              Tick speed, Tick delay, EtherDump *dump);
+    EtherLink(const std::string &name, EtherInt *peer0, EtherInt *peer1,
+              double rate, Tick delay, EtherDump *dump);
     virtual ~EtherLink();
 
     virtual void serialize(std::ostream &os);