Go to the documentation of this file.
41 #include "debug/Ethernet.hh"
42 #include "debug/EthernetData.hh"
46 #include "params/EtherBus.hh"
52 :
SimObject(
p), ticksPerByte(
p->speed), loopback(
p->loopback),
53 event([this]{
txDone(); },
"ethernet bus completion"),
54 sender(0),
dump(
p->dump)
61 devlist_t::iterator
i =
devlist.begin();
62 devlist_t::iterator end =
devlist.end();
64 DPRINTF(Ethernet,
"ethernet packet received: length=%d\n",
packet->length);
85 panic(
"Etherbus doesn't work\n");
92 DPRINTF(Ethernet,
"ethernet packet not sent, bus busy\n",
curTick());
96 DPRINTF(Ethernet,
"ethernet packet sent: length=%d\n", pkt->length);
97 DDUMP(EthernetData, pkt->data, pkt->length);
101 int delay = (int)ceil(((
double)pkt->simLength *
ticksPerByte) + 1.0);
102 DPRINTF(Ethernet,
"scheduling packet: delay=%d, (rate=%f)\n",
110 EtherBusParams::create()
virtual void sendDone()=0
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
EventFunctionWrapper event
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void schedule(Event &event, Tick when)
Ports are used to interface objects to each other.
#define DDUMP(x, data, count)
DPRINTF is a debugging trace facility that allows one to selectively enable tracing statements.
std::shared_ptr< EthPacketData > EthPacketPtr
EtherBus(const Params *p)
Overload hash function for BasicBlockRange type.
void dump()
Dump all statistics data to the registered outputs.
bool send(EtherInt *sender, EthPacketPtr &packet)
void dump(EthPacketPtr &pkt)
#define panic(...)
This implements a cprintf based panic() function.
Tick curTick()
The current simulated tick.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17