43 #include "debug/Ethernet.hh"
44 #include "debug/EthernetData.hh"
48 #include "params/EtherBus.hh"
54 :
EtherObject(p), ticksPerByte(p->speed), loopback(p->loopback),
62 devlist_t::iterator
i =
devlist.begin();
63 devlist_t::iterator end =
devlist.end();
65 DPRINTF(Ethernet,
"ethernet packet received: length=%d\n",
packet->length);
86 panic(
"Etherbus doesn't work\n");
93 DPRINTF(Ethernet,
"ethernet packet not sent, bus busy\n",
curTick());
97 DPRINTF(Ethernet,
"ethernet packet sent: length=%d\n", pkt->length);
98 DDUMP(EthernetData, pkt->data, pkt->length);
102 int delay = (int)ceil(((
double)pkt->simLength *
ticksPerByte) + 1.0);
103 DPRINTF(Ethernet,
"scheduling packet: delay=%d, (rate=%f)\n",
104 delay, ticksPerByte);
111 EtherBusParams::create()
virtual EtherInt * getEthPort(const std::string &if_name, int idx)
Additional function to return the Port of a memory object.
#define DDUMP(x, data, count)
EtherBus(const Params *p)
bool send(EtherInt *sender, EthPacketPtr &packet)
Tick curTick()
The current simulated tick.
void dump(EthPacketPtr &pkt)
std::shared_ptr< EthPacketData > EthPacketPtr
The base EtherObject class, allows for an accesor function to a simobj that returns the Port...
virtual void sendDone()=0
void schedule(Event &event, Tick when)
void dump()
Dump all statistics data to the registered outputs.