From 773cb77656174b221c1e51b92a8af7d8e268b733 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 16 Aug 2007 16:49:02 -0400 Subject: Devices: Make EtherInts connect in the same way memory ports currently do. --HG-- extra : convert_revision : 765b096785a77df9adc4791c9101b90696bd7be2 --- src/dev/etherbus.hh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/dev/etherbus.hh') diff --git a/src/dev/etherbus.hh b/src/dev/etherbus.hh index 2ff1d0a5e..a3a7f0606 100644 --- a/src/dev/etherbus.hh +++ b/src/dev/etherbus.hh @@ -37,11 +37,13 @@ #include "sim/eventq.hh" #include "dev/etherpkt.hh" +#include "dev/etherobject.hh" +#include "params/EtherBus.hh" #include "sim/sim_object.hh" class EtherDump; class EtherInt; -class EtherBus : public SimObject +class EtherBus : public EtherObject { protected: typedef std::list devlist_t; @@ -68,14 +70,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__ -- cgit v1.2.3