summaryrefslogtreecommitdiff
path: root/src/dev/sinic.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@arm.com>2012-11-02 11:32:01 -0500
committerAndreas Sandberg <Andreas.Sandberg@arm.com>2012-11-02 11:32:01 -0500
commitdf02047d5a362296bde9d07dba6dba59516fa328 (patch)
treeb52f0bb518cee1c19c49061595defa29f0afcc68 /src/dev/sinic.hh
parentc0ab52799ca4ebd0a51363cfedd0658e6d79b842 (diff)
downloadgem5-df02047d5a362296bde9d07dba6dba59516fa328.tar.xz
dev: Fix ethernet device inheritance structure
The Python wrappers and the C++ should have the same object structure. If this is not the case, bad things will happen when the SWIG wrappers cast between an object and any of its base classes. This was not the case for NSGigE and Sinic devices. This patch makes NSGigE and Sinic inherit from the new EtherDevBase class, which in turn inherits from EtherDevice. As a bonus, this removes some duplicated statistics from the Sinic device.
Diffstat (limited to 'src/dev/sinic.hh')
-rw-r--r--src/dev/sinic.hh29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/dev/sinic.hh b/src/dev/sinic.hh
index 5532650c3..8189ce39a 100644
--- a/src/dev/sinic.hh
+++ b/src/dev/sinic.hh
@@ -33,6 +33,7 @@
#include "base/inet.hh"
#include "base/statistics.hh"
+#include "dev/etherdevice.hh"
#include "dev/etherint.hh"
#include "dev/etherpkt.hh"
#include "dev/io_device.hh"
@@ -45,7 +46,7 @@
namespace Sinic {
class Interface;
-class Base : public PciDev
+class Base : public EtherDevBase
{
protected:
bool rxEnable;
@@ -281,32 +282,6 @@ class Device : public Base
* Statistics
*/
private:
- Stats::Scalar rxBytes;
- Stats::Formula rxBandwidth;
- Stats::Scalar rxPackets;
- Stats::Formula rxPacketRate;
- Stats::Scalar rxIpPackets;
- Stats::Scalar rxTcpPackets;
- Stats::Scalar rxUdpPackets;
- Stats::Scalar rxIpChecksums;
- Stats::Scalar rxTcpChecksums;
- Stats::Scalar rxUdpChecksums;
-
- Stats::Scalar txBytes;
- Stats::Formula txBandwidth;
- Stats::Formula totBandwidth;
- Stats::Formula totPackets;
- Stats::Formula totBytes;
- Stats::Formula totPacketRate;
- Stats::Scalar txPackets;
- Stats::Formula txPacketRate;
- Stats::Scalar txIpPackets;
- Stats::Scalar txTcpPackets;
- Stats::Scalar txUdpPackets;
- Stats::Scalar txIpChecksums;
- Stats::Scalar txTcpChecksums;
- Stats::Scalar txUdpChecksums;
-
Stats::Scalar totalVnicDistance;
Stats::Scalar numVnicDistance;
Stats::Scalar maxVnicDistance;