ruby: network: garnet: remove functions for computing power
[gem5.git] / src / dev / etherbus.hh
index 4a364abd81ad7a6f4debf5a4300df56e3ac8f1f0..43978b9c23e490cbef9eea1bb889f568e27fd0a5 100644 (file)
@@ -24,6 +24,8 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Nathan Binkert
  */
 
 /* @file
 #ifndef __ETHERBUS_H__
 #define __ETHERBUS_H__
 
-#include "sim/eventq.hh"
+#include "dev/etherobject.hh"
 #include "dev/etherpkt.hh"
+#include "params/EtherBus.hh"
+#include "sim/eventq.hh"
 #include "sim/sim_object.hh"
 
 class EtherDump;
 class EtherInt;
-class EtherBus : public SimObject
+class EtherBus : public EtherObject
 {
   protected:
     typedef std::list<EtherInt *> devlist_t;
@@ -54,10 +58,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;
@@ -66,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<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__