gem5  v21.1.0.2
Classes | Public Member Functions | Protected Attributes | List of all members
gem5::EtherSwitch::Interface::PortFifo Class Reference

#include <etherswitch.hh>

Inheritance diagram for gem5::EtherSwitch::Interface::PortFifo:
gem5::Serializable

Classes

struct  EntryOrder
 

Public Member Functions

 PortFifo (const std::string &name, int max)
 
 ~PortFifo ()
 
const std::string name ()
 
int avail () const
 
EthPacketPtr front ()
 
bool empty () const
 
unsigned size () const
 
bool push (EthPacketPtr ptr, unsigned senderId)
 Push a packet into the fifo and sort the packets with same recv tick by port id. More...
 
void pop ()
 
void clear ()
 
void serialize (CheckpointOut &cp) const
 Serialization stuff. More...
 
void unserialize (CheckpointIn &cp)
 Unserialize an object. More...
 
- Public Member Functions inherited from gem5::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 Attributes

std::set< PortFifoEntry, EntryOrderfifo
 
const std::string objName
 
const unsigned _maxsize
 
unsigned _size
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

Detailed Description

Definition at line 120 of file etherswitch.hh.

Constructor & Destructor Documentation

◆ PortFifo()

gem5::EtherSwitch::Interface::PortFifo::PortFifo ( const std::string &  name,
int  max 
)
inline

Definition at line 141 of file etherswitch.hh.

◆ ~PortFifo()

gem5::EtherSwitch::Interface::PortFifo::~PortFifo ( )
inline

Definition at line 143 of file etherswitch.hh.

Member Function Documentation

◆ avail()

int gem5::EtherSwitch::Interface::PortFifo::avail ( ) const
inline

Definition at line 151 of file etherswitch.hh.

References _maxsize, and _size.

Referenced by push().

◆ clear()

void gem5::EtherSwitch::Interface::PortFifo::clear ( )

Definition at line 120 of file etherswitch.cc.

◆ empty()

bool gem5::EtherSwitch::Interface::PortFifo::empty ( ) const
inline

Definition at line 154 of file etherswitch.hh.

References _size.

Referenced by push().

◆ front()

EthPacketPtr gem5::EtherSwitch::Interface::PortFifo::front ( )
inline

Definition at line 153 of file etherswitch.hh.

References fifo.

◆ name()

const std::string gem5::EtherSwitch::Interface::PortFifo::name ( )
inline

Definition at line 145 of file etherswitch.hh.

References objName.

◆ pop()

void gem5::EtherSwitch::Interface::PortFifo::pop ( )

Definition at line 108 of file etherswitch.cc.

◆ push()

bool gem5::EtherSwitch::Interface::PortFifo::push ( EthPacketPtr  ptr,
unsigned  senderId 
)

Push a packet into the fifo and sort the packets with same recv tick by port id.

Definition at line 76 of file etherswitch.cc.

References _maxsize, _size, avail(), gem5::curTick(), DPRINTF, empty(), fifo, and warn.

◆ serialize()

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

Serialization stuff.

Implements gem5::Serializable.

Definition at line 320 of file etherswitch.cc.

References gem5::csprintf(), gem5::ArmISA::i, and SERIALIZE_SCALAR.

◆ size()

unsigned gem5::EtherSwitch::Interface::PortFifo::size ( ) const
inline

Definition at line 155 of file etherswitch.hh.

References _size.

◆ unserialize()

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

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 333 of file etherswitch.cc.

References gem5::csprintf(), gem5::ArmISA::i, UNSERIALIZE_SCALAR, and gem5::Serializable::unserializeSection().

Member Data Documentation

◆ _maxsize

const unsigned gem5::EtherSwitch::Interface::PortFifo::_maxsize
protected

Definition at line 137 of file etherswitch.hh.

Referenced by avail(), and push().

◆ _size

unsigned gem5::EtherSwitch::Interface::PortFifo::_size
protected

Definition at line 138 of file etherswitch.hh.

Referenced by avail(), empty(), push(), and size().

◆ fifo

std::set<PortFifoEntry, EntryOrder> gem5::EtherSwitch::Interface::PortFifo::fifo
protected

Definition at line 134 of file etherswitch.hh.

Referenced by front(), and push().

◆ objName

const std::string gem5::EtherSwitch::Interface::PortFifo::objName
protected

Definition at line 136 of file etherswitch.hh.

Referenced by name().


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

Generated on Tue Sep 21 2021 12:27:31 for gem5 by doxygen 1.8.17