X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fdev%2Fetherbus.hh;h=6408f7f1f18d885fec560a37f0622314a0da889a;hb=2eae11be6499effbcf33e4f3ea747a7280adf86c;hp=2ff1d0a5e5cf7e1785023e34384a427b9281697a;hpb=b36796914af8bfc6729cc8a519e57572460e43e8;p=gem5.git diff --git a/src/dev/etherbus.hh b/src/dev/etherbus.hh index 2ff1d0a5e..6408f7f1f 100644 --- a/src/dev/etherbus.hh +++ b/src/dev/etherbus.hh @@ -37,11 +37,14 @@ #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 devlist_t; @@ -56,10 +59,10 @@ class EtherBus : public SimObject EtherBus *bus; public: - DoneEvent(EventQueue *q, EtherBus *b) - : Event(q), bus(b) {} + DoneEvent(EtherBus *b) : bus(b) {} virtual void process() { bus->txDone(); } - virtual const char *description() { return "ethernet bus completion"; } + virtual const char *description() const + { return "ethernet bus completion"; } }; DoneEvent event; @@ -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(_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__