48#ifndef __DEV_DIST_ETHERLINK_HH__
49#define __DEV_DIST_ETHERLINK_HH__
56#include "params/DistEtherLink.hh"
228 virtual void init()
override;
229 virtual void startup()
override;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Model base class for a single uni-directional link.
Link(const std::string &name, DistEtherLink *p, EtherDump *d, Event *e)
void setLocalInt(LocalIface *i)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
const std::string name() const
Interface to the local simulated system.
LocalIface(const std::string &name, TxLink *tx, RxLink *rx, DistIface *m)
bool recvPacket(EthPacketPtr pkt)
Model for a receive link.
RxLink(const std::string &name, DistEtherLink *p, Tick delay, EtherDump *d)
EventFunctionWrapper _doneEvent
Tick linkDelay
Transmission delay for the simulated Ethernet link.
const EventFunctionWrapper * doneEvent() const
Done events will be scheduled by DistIface (so we need the accessor)
void setDistInt(DistIface *m)
Register our dist interface to talk to the peer gem5 processes.
void rxDone()
Receive done callback method.
Tick delayVar
Random component of the send delay.
void txDone()
Send done callback.
double ticksPerByte
Per byte send delay.
EventFunctionWrapper doneEvent
TxLink(const std::string &name, DistEtherLink *p, double invBW, Tick delay_var, EtherDump *d)
void setDistInt(DistIface *m)
Register the dist interface to be used to talk to the peer gem5 processes.
bool transmit(EthPacketPtr packet)
Initiate sending of a packet via this link.
Model for a fixed bandwidth full duplex ethernet link.
DistEtherLinkParams Params
DistEtherLink(const Params &p)
virtual void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
DistIface * distIface
Interface to talk to the peer gem5 processes.
TxLink * txLink
Send link.
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual void startup() override
startup() is the final initialization call before simulation.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
RxLink * rxLink
Receive link.
The interface class to talk to peer gem5 processes.
virtual void sendDone()=0
const std::string & name() const
Return port name (for DPRINTF).
Ports are used to interface objects to each other.
Basic support for object serialization.
Abstract superclass for simulation objects.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
std::ostream CheckpointOut
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
std::shared_ptr< EthPacketData > EthPacketPtr