gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
etherdevice.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * Authors: Ali Saidi
29  */
30 
36 #ifndef __DEV_NET_ETHERDEVICE_HH__
37 #define __DEV_NET_ETHERDEVICE_HH__
38 
39 #include "base/statistics.hh"
40 #include "dev/pci/device.hh"
41 #include "params/EtherDevBase.hh"
42 #include "params/EtherDevice.hh"
43 #include "sim/sim_object.hh"
44 
45 class EtherInt;
46 
51 class EtherDevice : public PciDevice
52 {
53  public:
54  typedef EtherDeviceParams Params;
56  : PciDevice(params)
57  {}
58 
59  const Params *
60  params() const
61  {
62  return dynamic_cast<const Params *>(_params);
63  }
64 
65  public:
67  virtual EtherInt *getEthPort(const std::string &if_name, int idx = -1) = 0;
68 
69  public:
70  void regStats();
71 
72  protected:
122 };
123 
134 class EtherDevBase : public EtherDevice
135 {
136  public:
137  EtherDevBase(const EtherDevBaseParams *params)
138  : EtherDevice(params)
139  {}
140 
141  const EtherDevBaseParams *
142  params() const
143  {
144  return dynamic_cast<const EtherDevBaseParams *>(_params);
145  }
146 
147 };
148 
149 #endif // __DEV_NET_ETHERDEVICE_HH__
150 
EtherDevice(const Params *params)
Definition: etherdevice.hh:55
Stats::Formula totBandwidth
Definition: etherdevice.hh:87
Stats::Scalar postedSwi
Definition: etherdevice.hh:95
Stats::Scalar totalRxIdle
Definition: etherdevice.hh:100
Stats::Scalar descDmaReads
Definition: etherdevice.hh:83
Stats::Scalar descDmaWrites
Definition: etherdevice.hh:84
Dummy class to keep the Python class hierarchy in sync with the C++ object hierarchy.
Definition: etherdevice.hh:134
PCI device, base implementation is only config space.
Definition: device.hh:70
Stats::Scalar totalRxOk
Definition: etherdevice.hh:103
Stats::Scalar totalTxOk
Definition: etherdevice.hh:109
Stats::Scalar rxIpChecksums
Definition: etherdevice.hh:78
Stats::Scalar rxUdpChecksums
Definition: etherdevice.hh:82
const EtherDevBaseParams * params() const
Definition: etherdevice.hh:142
Stats::Scalar postedRxIdle
Definition: etherdevice.hh:98
Stats::Scalar totalRxDesc
Definition: etherdevice.hh:106
Stats::Scalar rxTcpChecksums
Definition: etherdevice.hh:80
Stats::Scalar txBytes
Definition: etherdevice.hh:73
Stats::Formula coalescedRxOrn
Definition: etherdevice.hh:117
Stats::Formula totPackets
Definition: etherdevice.hh:88
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2475
virtual EtherInt * getEthPort(const std::string &if_name, int idx=-1)=0
Additional function to return the Port of a memory object.
Stats::Scalar postedTxDesc
Definition: etherdevice.hh:113
Stats::Formula coalescedTxOk
Definition: etherdevice.hh:108
Stats::Scalar postedTxOk
Definition: etherdevice.hh:107
Stats::Scalar rxPackets
Definition: etherdevice.hh:76
Stats::Formula coalescedTxDesc
Definition: etherdevice.hh:114
const Params * params() const
Definition: etherdevice.hh:60
Stats::Formula txBandwidth
Definition: etherdevice.hh:91
void regStats()
Register statistics for this object.
Definition: etherdevice.cc:37
Stats::Scalar totalTxDesc
Definition: etherdevice.hh:115
DmaDeviceParams Params
Definition: dma_device.hh:160
Stats::Formula coalescedTxIdle
Definition: etherdevice.hh:111
Stats::Scalar totalRxOrn
Definition: etherdevice.hh:118
Stats::Scalar descDmaWrBytes
Definition: etherdevice.hh:86
Stats::Scalar txIpChecksums
Definition: etherdevice.hh:77
Stats::Scalar postedTxIdle
Definition: etherdevice.hh:110
Stats::Scalar droppedPackets
Definition: etherdevice.hh:121
Stats::Scalar descDmaRdBytes
Definition: etherdevice.hh:85
Stats::Formula coalescedSwi
Definition: etherdevice.hh:96
Stats::Scalar postedRxOk
Definition: etherdevice.hh:101
Stats::Scalar rxBytes
Definition: etherdevice.hh:74
Stats::Scalar totalTxIdle
Definition: etherdevice.hh:112
A formula for statistics that is calculated when printed.
Definition: statistics.hh:2895
EtherDeviceParams Params
Definition: etherdevice.hh:54
Stats::Formula coalescedRxIdle
Definition: etherdevice.hh:99
Stats::Scalar txUdpChecksums
Definition: etherdevice.hh:81
Stats::Scalar postedRxOrn
Definition: etherdevice.hh:116
Stats::Formula txPacketRate
Definition: etherdevice.hh:93
Stats::Formula coalescedTotal
Definition: etherdevice.hh:119
Stats::Formula totBytes
Definition: etherdevice.hh:89
Stats::Scalar postedRxDesc
Definition: etherdevice.hh:104
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:107
Stats::Scalar totalSwi
Definition: etherdevice.hh:97
The base EtherObject class, allows for an accesor function to a simobj that returns the Port...
Definition: etherdevice.hh:51
Stats::Formula rxPacketRate
Definition: etherdevice.hh:94
Stats::Formula rxBandwidth
Definition: etherdevice.hh:92
Stats::Scalar postedInterrupts
Definition: etherdevice.hh:120
Stats::Formula coalescedRxDesc
Definition: etherdevice.hh:105
EtherDevBase(const EtherDevBaseParams *params)
Definition: etherdevice.hh:137
Stats::Formula coalescedRxOk
Definition: etherdevice.hh:102
Stats::Scalar txTcpChecksums
Definition: etherdevice.hh:79
Stats::Formula totPacketRate
Definition: etherdevice.hh:90
Stats::Scalar txPackets
Definition: etherdevice.hh:75

Generated on Fri Jun 9 2017 13:03:46 for gem5 by doxygen 1.8.6