36 #ifndef __DEV_ETHERSWITCH_HH__
37 #define __DEV_ETHERSWITCH_HH__
48 #include "params/EtherSwitch.hh"
74 uint64_t outputBufferSize,
Tick delay,
Tick delay_var,
75 double rate,
unsigned id);
134 std::set<PortFifoEntry, EntryOrder>
fifo;
195 #endif // __DEV_ETHERSWITCH_HH__
void serialize(CheckpointOut &cp) const
Serialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void serialize(CheckpointOut &cp) const
Serialize an object.
PortFifoEntry(EthPacketPtr pkt, Tick recv_tick, unsigned id)
bool recvPacket(EthPacketPtr packet)
When a packet is received from a device, route it through an (several) output queue(s) ...
Interface(const std::string &name, EtherSwitch *_etherSwitch, uint64_t outputBufferSize, Tick delay, Tick delay_var, double rate, unsigned id)
Model for an Ethernet switch port.
const std::string objName
std::vector< Interface * > interfaces
std::map< uint64_t, SwitchTableEntry > forwardingTable
PortFifo(const std::string &name, int max)
PortFifo outputFifo
output fifo at each interface
void learnSenderAddr(Net::EthAddr srcMacAddr, Interface *sender)
Interface * lookupDestPort(Net::EthAddr destAddr)
std::set< PortFifoEntry, EntryOrder > fifo
uint64_t Tick
Tick count type.
void unserialize(CheckpointIn &cp)
Unserialize an object.
std::shared_ptr< EthPacketData > EthPacketPtr
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const
Serialization stuff.
EtherInt * getEthPort(const std::string &if_name, int idx) override
Additional function to return the Port of a memory object.
bool operator()(const PortFifoEntry &lhs, const PortFifoEntry &rhs) const
Basic support for object serialization.
The base EtherObject class, allows for an accesor function to a simobj that returns the Port...
bool push(EthPacketPtr ptr, unsigned senderId)
Push a packet into the fifo and sort the packets with same recv tick by port id.
const unsigned interfaceId
EtherSwitch(const Params *p)
const double ticksPerByte
const Params * params() const
std::ostream CheckpointOut
void unserialize(CheckpointIn &cp)
Unserialize an object.
void enqueue(EthPacketPtr packet, unsigned senderId)
enqueue packet to the outputFifo
const SimObjectParams * _params
Cached copy of the object parameters.
const std::string & name() const
Return port name (for DPRINTF).
EventWrapper< Interface,&Interface::transmit > txEvent
Base Ethernet Object declaration.
void unserialize(CheckpointIn &cp)
Unserialize an object.