gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::EtherLink::Link Class Reference

#include <etherlink.hh>

Public Member Functions

 Link (const std::string &name, EtherLink *p, int num, double rate, Tick delay, Tick delay_var, EtherDump *dump)
 
 ~Link ()
 
const std::string name () const
 
bool busy () const
 
bool transmit (EthPacketPtr packet)
 
void setTxInt (Interface *i)
 
void setRxInt (Interface *i)
 
void serialize (const std::string &base, CheckpointOut &cp) const
 
void unserialize (const std::string &base, CheckpointIn &cp)
 

Protected Member Functions

void txDone ()
 
void processTxQueue ()
 
void txComplete (EthPacketPtr packet)
 

Protected Attributes

const std::string objName
 
EtherLink *const parent
 
const int number
 
Interfacetxint
 
Interfacerxint
 
const double ticksPerByte
 
const Tick linkDelay
 
const Tick delayVar
 
EtherDump *const dump
 
Random::RandomPtr rng = Random::genRandom()
 
EthPacketPtr packet
 
EventFunctionWrapper doneEvent
 
std::deque< std::pair< Tick, EthPacketPtr > > txQueue
 Maintain a queue of in-flight packets.
 
EventFunctionWrapper txQueueEvent
 

Detailed Description

Definition at line 75 of file etherlink.hh.

Constructor & Destructor Documentation

◆ Link()

gem5::EtherLink::Link::Link ( const std::string & name,
EtherLink * p,
int num,
double rate,
Tick delay,
Tick delay_var,
EtherDump * dump )

◆ ~Link()

gem5::EtherLink::Link::~Link ( )
inline

Definition at line 116 of file etherlink.hh.

Member Function Documentation

◆ busy()

bool gem5::EtherLink::Link::busy ( ) const
inline

Definition at line 120 of file etherlink.hh.

References packet.

Referenced by transmit(), and txDone().

◆ name()

const std::string gem5::EtherLink::Link::name ( ) const
inline

Definition at line 118 of file etherlink.hh.

References objName.

Referenced by Link().

◆ processTxQueue()

void gem5::EtherLink::Link::processTxQueue ( )
protected

Definition at line 161 of file etherlink.cc.

References gem5::curTick(), parent, txComplete(), txQueue, and txQueueEvent.

◆ serialize()

void gem5::EtherLink::Link::serialize ( const std::string & base,
CheckpointOut & cp ) const

◆ setRxInt()

void gem5::EtherLink::Link::setRxInt ( Interface * i)
inline

Definition at line 124 of file etherlink.hh.

References gem5::ArmISA::i, and rxint.

Referenced by gem5::EtherLink::Interface::Interface().

◆ setTxInt()

void gem5::EtherLink::Link::setTxInt ( Interface * i)
inline

Definition at line 123 of file etherlink.hh.

References gem5::ArmISA::i, and txint.

Referenced by gem5::EtherLink::Interface::Interface().

◆ transmit()

bool gem5::EtherLink::Link::transmit ( EthPacketPtr packet)

Definition at line 178 of file etherlink.cc.

References busy(), gem5::curTick(), DDUMP, delayVar, doneEvent, DPRINTF, packet, parent, rng, and ticksPerByte.

◆ txComplete()

void gem5::EtherLink::Link::txComplete ( EthPacketPtr packet)
protected

Definition at line 131 of file etherlink.cc.

References DDUMP, DPRINTF, packet, and rxint.

Referenced by processTxQueue(), and txDone().

◆ txDone()

void gem5::EtherLink::Link::txDone ( )
protected

Definition at line 139 of file etherlink.cc.

References busy(), gem5::curTick(), DPRINTF, dump, linkDelay, packet, parent, txComplete(), txint, txQueue, and txQueueEvent.

Referenced by Link().

◆ unserialize()

void gem5::EtherLink::Link::unserialize ( const std::string & base,
CheckpointIn & cp )

Member Data Documentation

◆ delayVar

const Tick gem5::EtherLink::Link::delayVar
protected

Definition at line 88 of file etherlink.hh.

Referenced by Link(), and transmit().

◆ doneEvent

EventFunctionWrapper gem5::EtherLink::Link::doneEvent
protected

Definition at line 99 of file etherlink.hh.

Referenced by Link(), serialize(), transmit(), and unserialize().

◆ dump

EtherDump* const gem5::EtherLink::Link::dump
protected

Definition at line 89 of file etherlink.hh.

Referenced by Link(), and txDone().

◆ linkDelay

const Tick gem5::EtherLink::Link::linkDelay
protected

Definition at line 87 of file etherlink.hh.

Referenced by Link(), and txDone().

◆ number

const int gem5::EtherLink::Link::number
protected

Definition at line 81 of file etherlink.hh.

Referenced by Link().

◆ objName

const std::string gem5::EtherLink::Link::objName
protected

Definition at line 78 of file etherlink.hh.

Referenced by Link(), and name().

◆ packet

EthPacketPtr gem5::EtherLink::Link::packet
protected

Definition at line 97 of file etherlink.hh.

Referenced by busy(), serialize(), transmit(), txComplete(), txDone(), and unserialize().

◆ parent

EtherLink* const gem5::EtherLink::Link::parent
protected

Definition at line 80 of file etherlink.hh.

Referenced by Link(), processTxQueue(), transmit(), txDone(), and unserialize().

◆ rng

Random::RandomPtr gem5::EtherLink::Link::rng = Random::genRandom()
protected

Definition at line 91 of file etherlink.hh.

Referenced by transmit().

◆ rxint

Interface* gem5::EtherLink::Link::rxint
protected

Definition at line 84 of file etherlink.hh.

Referenced by Link(), setRxInt(), and txComplete().

◆ ticksPerByte

const double gem5::EtherLink::Link::ticksPerByte
protected

Definition at line 86 of file etherlink.hh.

Referenced by Link(), and transmit().

◆ txint

Interface* gem5::EtherLink::Link::txint
protected

Definition at line 83 of file etherlink.hh.

Referenced by Link(), setTxInt(), and txDone().

◆ txQueue

std::deque<std::pair<Tick, EthPacketPtr> > gem5::EtherLink::Link::txQueue
protected

Maintain a queue of in-flight packets.

Assume that the delay is non-zero and constant (i.e., at most one packet per tick).

Definition at line 106 of file etherlink.hh.

Referenced by processTxQueue(), serialize(), txDone(), and unserialize().

◆ txQueueEvent

EventFunctionWrapper gem5::EtherLink::Link::txQueueEvent
protected

Definition at line 109 of file etherlink.hh.

Referenced by processTxQueue(), txDone(), and unserialize().


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

Generated on Mon May 26 2025 09:19:20 for gem5 by doxygen 1.13.2