diff options
author | Gabe Black <gabeblack@google.com> | 2019-03-06 17:38:23 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-03-15 18:13:46 +0000 |
commit | b482cff6c3330d1c43d5c8d18d25731f552f02ee (patch) | |
tree | 92c2a6059bcfec85e726a18b806b358723c8f70e /src/dev | |
parent | f5ba0d66459c1c035d4613376d1d39af08e483de (diff) | |
download | gem5-b482cff6c3330d1c43d5c8d18d25731f552f02ee.tar.xz |
dev: Make the EtherDevice class inherit EtherObject.
This avoids having to define two parallel versions of the getEthPort
function, and the complex dynamic_cast macrame in connectPorts().
Change-Id: I24c09864005ff39a049e50d7245ff17e9480edea
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17029
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/net/Ethernet.py | 1 | ||||
-rw-r--r-- | src/dev/net/etherdevice.hh | 11 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/dev/net/Ethernet.py b/src/dev/net/Ethernet.py index 6e900e0e8..0cf37e230 100644 --- a/src/dev/net/Ethernet.py +++ b/src/dev/net/Ethernet.py @@ -127,6 +127,7 @@ class EtherDevice(PciDevice): type = 'EtherDevice' abstract = True cxx_header = "dev/net/etherdevice.hh" + cxx_extra_bases = [ "EtherObject" ] interface = MasterPort("Ethernet Interface") class IGbE(EtherDevice): diff --git a/src/dev/net/etherdevice.hh b/src/dev/net/etherdevice.hh index 3ce54958d..7101ec80a 100644 --- a/src/dev/net/etherdevice.hh +++ b/src/dev/net/etherdevice.hh @@ -37,6 +37,7 @@ #define __DEV_NET_ETHERDEVICE_HH__ #include "base/statistics.hh" +#include "dev/net/etherobject.hh" #include "dev/pci/device.hh" #include "params/EtherDevBase.hh" #include "params/EtherDevice.hh" @@ -44,11 +45,7 @@ class EtherInt; -/** - * The base EtherObject class, allows for an accesor function to a - * simobj that returns the Port. - */ -class EtherDevice : public PciDevice +class EtherDevice : public PciDevice, public EtherObject { public: typedef EtherDeviceParams Params; @@ -63,10 +60,6 @@ class EtherDevice : public PciDevice } public: - /** Additional function to return the Port of a memory object. */ - virtual EtherInt *getEthPort(const std::string &if_name, int idx = -1) = 0; - - public: void regStats(); protected: |