Go to the documentation of this file.
33 #ifndef __DEV_ETHERSWITCH_HH__
34 #define __DEV_ETHERSWITCH_HH__
44 #include "params/EtherSwitch.hh"
72 uint64_t outputBufferSize,
Tick delay,
Tick delay_var,
73 double rate,
unsigned id);
132 std::set<PortFifoEntry, EntryOrder>
fifo;
193 #endif // __DEV_ETHERSWITCH_HH__
void serialize(CheckpointOut &cp) const
Serialize an object.
std::set< PortFifoEntry, EntryOrder > fifo
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
std::vector< Interface * > interfaces
void serialize(CheckpointOut &cp) const
Serialize an object.
const PortID InvalidPortID
const double ticksPerByte
Basic support for object serialization.
void serialize(CheckpointOut &cp) const
Serialization stuff.
uint64_t Tick
Tick count type.
Model for an Ethernet switch port.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
PortFifoEntry(EthPacketPtr pkt, Tick recv_tick, unsigned id)
std::map< uint64_t, SwitchTableEntry > forwardingTable
bool push(EthPacketPtr ptr, unsigned senderId)
Push a packet into the fifo and sort the packets with same recv tick by port id.
void unserialize(CheckpointIn &cp)
Unserialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void learnSenderAddr(Net::EthAddr srcMacAddr, Interface *sender)
bool operator()(const PortFifoEntry &lhs, const PortFifoEntry &rhs) const
EtherSwitch(const Params *p)
Ports are used to interface objects to each other.
void enqueue(EthPacketPtr packet, unsigned senderId)
enqueue packet to the outputFifo
const PortID id
A numeric identifier to distinguish ports in a vector, and set to InvalidPortID in case this port is ...
const std::string objName
PortFifo outputFifo
output fifo at each interface
std::shared_ptr< EthPacketData > EthPacketPtr
Interface(const std::string &name, EtherSwitch *_etherSwitch, uint64_t outputBufferSize, Tick delay, Tick delay_var, double rate, unsigned id)
const std::string & name() const
Return port name (for DPRINTF).
PortFifo(const std::string &name, int max)
const SimObjectParams * _params
Cached copy of the object parameters.
Interface * lookupDestPort(Net::EthAddr destAddr)
bool recvPacket(EthPacketPtr packet)
When a packet is received from a device, route it through an (several) output queue(s)
std::ostream CheckpointOut
EventFunctionWrapper txEvent
void serialize(CheckpointOut &cp) const override
Serialize an object.
void unserialize(CheckpointIn &cp)
Unserialize an object.
const Params * params() const
const unsigned interfaceId
void unserialize(CheckpointIn &cp)
Unserialize an object.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17