Merge with head.
[gem5.git] / src / dev / etherbus.hh
index 2ff1d0a5e5cf7e1785023e34384a427b9281697a..4deb7fccc91b0a87c0c54a6ee3cbe0b561f5ca2a 100644 (file)
 
 #include "sim/eventq.hh"
 #include "dev/etherpkt.hh"
+#include "dev/etherobject.hh"
+#include "params/EtherBus.hh"
 #include "sim/sim_object.hh"
+#include "params/EtherBus.hh"
 
 class EtherDump;
 class EtherInt;
-class EtherBus : public SimObject
+class EtherBus : public EtherObject
 {
   protected:
     typedef std::list<EtherInt *> devlist_t;
@@ -68,14 +71,21 @@ class EtherBus : public SimObject
     EtherDump *dump;
 
   public:
-    EtherBus(const std::string &name, double speed, bool loopback,
-             EtherDump *dump);
+    typedef EtherBusParams Params;
+    EtherBus(const Params *p);
     virtual ~EtherBus() {}
 
+    const Params *
+    params() const
+    {
+        return dynamic_cast<const Params *>(_params);
+    }
+
     void txDone();
     void reg(EtherInt *dev);
     bool busy() const { return (bool)packet; }
     bool send(EtherInt *sender, EthPacketPtr &packet);
+    virtual EtherInt *getEthPort(const std::string &if_name, int idx);
 };
 
 #endif // __ETHERBUS_H__