Gabe Black has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/17029 )
Change subject: dev: Make the EtherDevice class inherit EtherObject.
......................................................................
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 <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
---
M src/dev/net/Ethernet.py
M src/dev/net/etherdevice.hh
2 files changed, 3 insertions(+), 9 deletions(-)
Approvals:
Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
diff --git a/src/dev/net/Ethernet.py b/src/dev/net/Ethernet.py
index 6e900e0..0cf37e2 100644
--- a/src/dev/net/Ethernet.py
+++ b/src/dev/net/Ethernet.py
@@ -127,6 +127,7 @@
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 3ce5495..7101ec8 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 @@
}
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:
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17029
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I24c09864005ff39a049e50d7245ff17e9480edea
Gerrit-Change-Number: 17029
Gerrit-PatchSet: 5
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: Weiping Liao <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev