gem5  v22.1.0.0
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
gem5::DistIface::RecvScheduler Class Reference

Class to encapsulate information about data packets received. More...

Inheritance diagram for gem5::DistIface::RecvScheduler:
gem5::Serializable

Classes

struct  Desc
 Received packet descriptor. More...
 

Public Member Functions

 RecvScheduler (EventManager *em)
 Scheduler for the incoming data packets. More...
 
void init (Event *recv_done, Tick link_delay)
 Initialize network link parameters. More...
 
EthPacketPtr popPacket ()
 Fetch the next packet that is to be received by the simulated network link. More...
 
void pushPacket (EthPacketPtr new_packet, Tick send_tick, Tick send_delay)
 Push a newly arrived packet into the desc queue. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
void resumeRecvTicks ()
 Adjust receive ticks for pending packets when restoring from a checkpoint. 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)
 

Private Member Functions

Tick calcReceiveTick (Tick send_tick, Tick send_delay, Tick prev_recv_tick)
 Calculate the tick to schedule the next receive done event. More...
 

Private Attributes

std::queue< DescdescQueue
 The queue to store the receive descriptors. More...
 
Tick prevRecvTick
 The tick when the most recent receive event was processed. More...
 
EventrecvDone
 The receive done event for the simulated Ethernet link. More...
 
Tick linkDelay
 The link delay in ticks for the simulated Ethernet link. More...
 
EventManagereventManager
 The event manager associated with the simulated Ethernet link. More...
 
bool ckptRestore
 Flag to set if receive ticks for pending packets need to be recalculated due to changed link latencies at a resume. More...
 

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

Class to encapsulate information about data packets received.

Note
The main purpose of the class to take care of scheduling receive done events for the simulated network link and store incoming packets until they can be received by the simulated network link.

Definition at line 333 of file dist_iface.hh.

Constructor & Destructor Documentation

◆ RecvScheduler()

gem5::DistIface::RecvScheduler::RecvScheduler ( EventManager em)
inline

Scheduler for the incoming data packets.

Parameters
emThe event manager associated with the simulated Ethernet link.

Definition at line 418 of file dist_iface.hh.

Member Function Documentation

◆ calcReceiveTick()

Tick gem5::DistIface::RecvScheduler::calcReceiveTick ( Tick  send_tick,
Tick  send_delay,
Tick  prev_recv_tick 
)
private

Calculate the tick to schedule the next receive done event.

Parameters
send_tickThe tick the packet was sent.
send_delayThe simulated delay at the sender side.
prev_recv_tickTick when the last receive event was processed.
Note
This method tries to take into account possible receiver link contention and adjust receive tick for the incoming packets accordingly.

Definition at line 444 of file dist_iface.cc.

References gem5::curTick(), and panic_if.

◆ init()

void gem5::DistIface::RecvScheduler::init ( Event recv_done,
Tick  link_delay 
)

Initialize network link parameters.

Note
This method is called from the receiver thread (see recvThreadFunc()).

Definition at line 432 of file dist_iface.cc.

References gem5::curEventQueue().

Referenced by gem5::DistIface::recvThreadFunc().

◆ popPacket()

EthPacketPtr gem5::DistIface::RecvScheduler::popPacket ( )

Fetch the next packet that is to be received by the simulated network link.

Note
This method is called from the process() method of the receive done event associated with the network link.

Definition at line 535 of file dist_iface.cc.

References gem5::curTick().

Referenced by gem5::DistIface::packetIn().

◆ pushPacket()

void gem5::DistIface::RecvScheduler::pushPacket ( EthPacketPtr  new_packet,
Tick  send_tick,
Tick  send_delay 
)

◆ resumeRecvTicks()

void gem5::DistIface::RecvScheduler::resumeRecvTicks ( )

Adjust receive ticks for pending packets when restoring from a checkpoint.

Note
Link speed and delay parameters may change at resume.

Definition at line 464 of file dist_iface.cc.

References gem5::curTick(), gem5::ArmISA::d, and gem5::VegaISA::v.

Referenced by gem5::DistIface::drainResume().

◆ serialize()

void gem5::DistIface::RecvScheduler::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 571 of file dist_iface.cc.

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

◆ unserialize()

void gem5::DistIface::RecvScheduler::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 587 of file dist_iface.cc.

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

Member Data Documentation

◆ ckptRestore

bool gem5::DistIface::RecvScheduler::ckptRestore
private

Flag to set if receive ticks for pending packets need to be recalculated due to changed link latencies at a resume.

Definition at line 409 of file dist_iface.hh.

◆ descQueue

std::queue<Desc> gem5::DistIface::RecvScheduler::descQueue
private

The queue to store the receive descriptors.

Definition at line 359 of file dist_iface.hh.

◆ eventManager

EventManager* gem5::DistIface::RecvScheduler::eventManager
private

The event manager associated with the simulated Ethernet link.

Note
It is used to access the event queue for scheduling receive done events for the link.

Definition at line 388 of file dist_iface.hh.

◆ linkDelay

Tick gem5::DistIface::RecvScheduler::linkDelay
private

The link delay in ticks for the simulated Ethernet link.

Note
This value is used for calculating the receive ticks for incoming data packets.

Definition at line 381 of file dist_iface.hh.

◆ prevRecvTick

Tick gem5::DistIface::RecvScheduler::prevRecvTick
private

The tick when the most recent receive event was processed.

Note
This information is necessary to simulate possible receiver link contention when calculating the receive tick for the next incoming data packet (see the calcReceiveTick() method)

Definition at line 367 of file dist_iface.hh.

◆ recvDone

Event* gem5::DistIface::RecvScheduler::recvDone
private

The receive done event for the simulated Ethernet link.

Note
This object is constructed by the simulated network link. We schedule this object for each incoming data packet.

Definition at line 374 of file dist_iface.hh.


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

Generated on Wed Dec 21 2022 10:23:20 for gem5 by doxygen 1.9.1