33#ifndef __DEV_NET_I8254XGBE_HH__
34#define __DEV_NET_I8254XGBE_HH__
43#include "debug/EthernetDesc.hh"
44#include "debug/EthernetIntr.hh"
51#include "params/IGbE.hh"
100 "Posting RXT interrupt because RDTR timer expired\n");
110 "Posting RXT interrupt because RADV timer expired\n");
120 "Posting TXDW interrupt because TADV timer expired\n");
130 "Posting TXDW interrupt because TIDV timer expired\n");
457 "Completion writeback Addr: %#x enabled: %d\n",
466 DPRINTF(EthernetDesc,
"Completion writeback complete\n");
483 void init()
override;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Addr cacheBlockSize() const
const std::string & name() const
Return port name (for DPRINTF).
IGbEInt(const std::string &name, IGbE *d)
virtual bool recvPacket(EthPacketPtr pkt)
virtual long descLen() const =0
virtual long descHead() const =0
void wbComplete()
Called by event when dma to writeback descriptors is completed.
unsigned descUsed() const
virtual void updateHead(long h)=0
virtual void actionAfterWb()
virtual Addr descBase() const =0
std::string annUsedCacheQ
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void areaChanged()
If the address/len/head change when we've got descriptors that are dirty that is very bad.
Addr pciToDma(Addr a)
Shortcut for DMA address translation.
EventFunctionWrapper fetchDelayEvent
unsigned descUnused() const
virtual void fetchAfterWb()=0
std::deque< T * > CacheType
virtual bool hasOutstandingEvents()
void fetchComplete()
Called by event when dma to read descriptors is completed.
std::string annUnusedDescQ
std::string annUnusedCacheQ
EventFunctionWrapper fetchEvent
virtual void enableSm()=0
unsigned descLeft() const
EthPacketPtr pktPtr
The packet that is currently being dmad to memory if any.
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual long descTail() const =0
void writeback(Addr aMask)
EventFunctionWrapper wbDelayEvent
void fetchDescriptors()
Fetch a chunk of descriptors into the descriptor cache.
EventFunctionWrapper wbEvent
DescCache(IGbE *i, const std::string n, int s)
std::string annSmFetch
Annotate sm.
bool hasOutstandingEvents() override
long descTail() const override
void fetchAfterWb() override
long descHead() const override
EventFunctionWrapper pktEvent
void pktComplete()
Called by event when dma to write packet is completed.
Addr descBase() const override
void updateHead(long h) override
int writePacket(EthPacketPtr packet, int pkt_offset)
Write the given packet into the buffer(s) pointed to by the descriptor and update the book keeping.
long descLen() const override
void serialize(CheckpointOut &cp) const override
Serialize an object.
unsigned bytesCopied
Bytes of packet that have been copied, so we know when to set EOP.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
EventFunctionWrapper pktHdrEvent
int splitCount
Variable to head with header/data completion events.
bool packetDone()
Check if the dma on the packet has completed and RX state machine can continue.
EventFunctionWrapper pktDataEvent
unsigned descInBlock(unsigned num_desc)
Return the number of dsecriptors in a cache block for threshold operations.
bool packetMultiDesc()
Ask if this packet is composed of multiple descriptors so even if we've got data, we need to wait for...
void completionWriteback(Addr a, bool enabled)
bool packetAvailable()
Ask if the packet has been transfered so the state machine can give it to the fifo.
bool packetWaiting()
Ask if we are still waiting for the packet to be transfered.
void fetchAfterWb() override
void getPacketData(EthPacketPtr p)
long descLen() const override
long descTail() const override
EventFunctionWrapper pktEvent
long descHead() const override
void processContextDesc()
bool hasOutstandingEvents() override
unsigned getPacketSize(EthPacketPtr p)
Tell the cache to DMA a packet from main memory into its buffer and return the size the of the packet...
EventFunctionWrapper headerEvent
void updateHead(long h) override
EventFunctionWrapper nullEvent
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Addr descBase() const override
void pktComplete()
Called by event when dma to write packet is completed.
void actionAfterWb() override
void serialize(CheckpointOut &cp) const override
Serialize an object.
EventFunctionWrapper interEvent
void postInterrupt(igbreg::IntTypes t, bool now=false)
Write an interrupt into the interrupt pending register and check mask and interrupt limit timer befor...
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void chkInterrupt()
Check and see if changes to the mask register have caused an interrupt to need to be sent or perhaps ...
EventFunctionWrapper tickEvent
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
IGbE(const Params ¶ms)
uint16_t flash[igbreg::EEPROM_SIZE]
void drainResume() override
Resume execution after a successful drain.
void cpuClearInt()
Clear the interupt line to the cpu.
EventFunctionWrapper radvEvent
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
EventFunctionWrapper tidvEvent
void serialize(CheckpointOut &cp) const override
Serialize an object.
Tick writeConfig(PacketPtr pkt) override
Write to the PCI config space data that is stored locally.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
EventFunctionWrapper tadvEvent
void checkDrain()
Check if all the draining things that need to occur have occured and handle the drain event if so.
bool ethRxPkt(EthPacketPtr packet)
void delayIntEvent()
Send an interrupt to the cpu.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void restartClock()
This function is used to restart the clock so it can handle things like draining and resume in one pl...
EventFunctionWrapper rdtrEvent
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Addr pciToDma(Addr pci_addr) const
Ports are used to interface objects to each other.
Basic support for object serialization.
Base Ethernet Device declaration.
DrainState drainState() const
Return the current drain state of an object.
DrainState
Object drain/handover states.
@ Running
Running normally.
bool scheduled() const
Determine if the current event is scheduled.
const Params & params() const
const uint8_t EEPROM_SIZE
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
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