Remote GDB: Turn on remote gdb in SE mode.
[gem5.git] / src / dev / etherbus.cc
index 348bb818a05888adffb951c5b26e6f9b175abbf3..2316bfed95cde3e940488743a16aad782a722970 100644 (file)
 #include "dev/etherdump.hh"
 #include "dev/etherint.hh"
 #include "dev/etherpkt.hh"
-#include "sim/builder.hh"
-#include "sim/root.hh"
+#include "params/EtherBus.hh"
+#include "sim/core.hh"
 
 using namespace std;
 
-EtherBus::EtherBus(const string &name, double speed, bool loop,
-                   EtherDump *packet_dump)
-    : SimObject(name), ticksPerByte(speed), loopback(loop),
-      event(&mainEventQueue, this), sender(0), dump(packet_dump)
+EtherBus::EtherBus(const Params *p)
+    : EtherObject(p), ticksPerByte(p->speed), loopback(p->loopback),
+      event(&mainEventQueue, this), sender(0), dump(p->dump)
 {
 }
 
@@ -78,9 +77,11 @@ EtherBus::txDone()
     packet = 0;
 }
 
-void
-EtherBus::reg(EtherInt *dev)
-{ devlist.push_back(dev); }
+EtherInt*
+EtherBus::getEthPort(const std::string &if_name, int idx)
+{
+    panic("Etherbus doesn't work\n");
+}
 
 bool
 EtherBus::send(EtherInt *sndr, EthPacketPtr &pkt)
@@ -103,25 +104,8 @@ EtherBus::send(EtherInt *sndr, EthPacketPtr &pkt)
     return true;
 }
 
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(EtherBus)
-
-    Param<bool> loopback;
-    Param<double> speed;
-    SimObjectParam<EtherDump *> packet_dump;
-
-END_DECLARE_SIM_OBJECT_PARAMS(EtherBus)
-
-BEGIN_INIT_SIM_OBJECT_PARAMS(EtherBus)
-
-    INIT_PARAM(loopback, "send the packet back to the sending interface"),
-    INIT_PARAM(speed, "bus speed in ticks per byte"),
-    INIT_PARAM(packet_dump, "object to dump network packets to")
-
-END_INIT_SIM_OBJECT_PARAMS(EtherBus)
-
-CREATE_SIM_OBJECT(EtherBus)
+EtherBus *
+EtherBusParams::create()
 {
-    return new EtherBus(getInstanceName(), speed, loopback, packet_dump);
+    return new EtherBus(this);
 }
-
-REGISTER_SIM_OBJECT("EtherBus", EtherBus)