gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
EtherSwitch::Interface Class Reference

Model for an Ethernet switch port. More...

#include <etherswitch.hh>

Inheritance diagram for EtherSwitch::Interface:
EtherInt Serializable

Classes

class  PortFifo
 
struct  PortFifoEntry
 

Public Member Functions

 Interface (const std::string &name, EtherSwitch *_etherSwitch, uint64_t outputBufferSize, Tick delay, Tick delay_var, double rate, unsigned id)
 
bool recvPacket (EthPacketPtr packet)
 When a packet is received from a device, route it through an (several) output queue(s) More...
 
void enqueue (EthPacketPtr packet, unsigned senderId)
 enqueue packet to the outputFifo More...
 
void sendDone ()
 
Tick switchingDelay ()
 
InterfacelookupDestPort (Net::EthAddr destAddr)
 
void learnSenderAddr (Net::EthAddr srcMacAddr, Interface *sender)
 
void serialize (CheckpointOut &cp) const
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp)
 Unserialize an object. More...
 
- Public Member Functions inherited from EtherInt
 EtherInt (const std::string &name)
 
virtual ~EtherInt ()
 
const std::string & name () const
 Return port name (for DPRINTF). More...
 
void setPeer (EtherInt *p)
 
EtherIntgetPeer ()
 
void recvDone ()
 
bool sendPacket (EthPacketPtr packet)
 
bool askBusy ()
 
virtual bool isBusy ()
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Protected Member Functions

void transmit ()
 

Protected Attributes

PortFifo outputFifo
 output fifo at each interface More...
 
EventWrapper< Interface,&Interface::transmittxEvent
 
- Protected Attributes inherited from EtherInt
std::string portName
 
EtherIntpeer
 

Private Attributes

const double ticksPerByte
 
const Tick switchDelay
 
const Tick delayVar
 
const unsigned interfaceId
 
EtherSwitchparent
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 

Detailed Description

Model for an Ethernet switch port.

Definition at line 70 of file etherswitch.hh.

Constructor & Destructor Documentation

EtherSwitch::Interface::Interface ( const std::string &  name,
EtherSwitch _etherSwitch,
uint64_t  outputBufferSize,
Tick  delay,
Tick  delay_var,
double  rate,
unsigned  id 
)

Definition at line 128 of file etherswitch.cc.

Member Function Documentation

void EtherSwitch::Interface::enqueue ( EthPacketPtr  packet,
unsigned  senderId 
)

enqueue packet to the outputFifo

Definition at line 166 of file etherswitch.cc.

References curTick().

Referenced by recvPacket().

void EtherSwitch::Interface::learnSenderAddr ( Net::EthAddr  srcMacAddr,
Interface sender 
)
EtherSwitch::Interface * EtherSwitch::Interface::lookupDestPort ( Net::EthAddr  destAddr)

Definition at line 214 of file etherswitch.cc.

References curTick(), and DPRINTF.

bool EtherSwitch::Interface::recvPacket ( EthPacketPtr  packet)
virtual

When a packet is received from a device, route it through an (several) output queue(s)

Implements EtherInt.

Definition at line 139 of file etherswitch.cc.

References Net::EthAddr::broadcast(), DPRINTF, enqueue(), Net::EthAddr::multicast(), EtherInt::name(), and SimObject::name().

void EtherSwitch::Interface::sendDone ( )
inlinevirtual

Implements EtherInt.

Definition at line 85 of file etherswitch.hh.

void EtherSwitch::Interface::serialize ( CheckpointOut cp) const
virtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 277 of file etherswitch.cc.

References SERIALIZE_SCALAR.

Tick EtherSwitch::Interface::switchingDelay ( )

Definition at line 203 of file etherswitch.cc.

References Random::random(), and random_mt.

void EtherSwitch::Interface::transmit ( )
protected

Definition at line 182 of file etherswitch.cc.

References curTick(), DPRINTF, and retryTime.

void EtherSwitch::Interface::unserialize ( CheckpointIn cp)
virtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 290 of file etherswitch.cc.

References UNSERIALIZE_SCALAR.

Member Data Documentation

const Tick EtherSwitch::Interface::delayVar
private

Definition at line 97 of file etherswitch.hh.

const unsigned EtherSwitch::Interface::interfaceId
private

Definition at line 98 of file etherswitch.hh.

PortFifo EtherSwitch::Interface::outputFifo
protected

output fifo at each interface

Definition at line 173 of file etherswitch.hh.

EtherSwitch* EtherSwitch::Interface::parent
private

Definition at line 100 of file etherswitch.hh.

const Tick EtherSwitch::Interface::switchDelay
private

Definition at line 96 of file etherswitch.hh.

const double EtherSwitch::Interface::ticksPerByte
private

Definition at line 95 of file etherswitch.hh.

EventWrapper<Interface, &Interface::transmit> EtherSwitch::Interface::txEvent
protected

Definition at line 175 of file etherswitch.hh.


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:09 for gem5 by doxygen 1.8.6