33 #ifndef __DEV_NET_I8254XGBE_HH__ 34 #define __DEV_NET_I8254XGBE_HH__ 41 #include "debug/EthernetDesc.hh" 42 #include "debug/EthernetIntr.hh" 49 #include "params/IGbE.hh" 95 "Posting RXT interrupt because RDTR timer expired\n");
105 "Posting RXT interrupt because RADV timer expired\n");
115 "Posting TXDW interrupt because TADV timer expired\n");
125 "Posting TXDW interrupt because TIDV timer expired\n");
180 void anQ(std::string
sm, std::string
q) {
190 void anPq(std::string
sm, std::string
q,
int num = 1) {
195 void anRq(std::string
sm, std::string
q,
int num = 1) {
218 virtual long descLen()
const = 0;
305 unsigned left = unusedCache.size();
316 unsigned descUsed()
const {
return usedCache.size(); }
433 uint8_t tsoHeader[256];
447 void processContextDesc();
462 bool packetAvailable();
482 void headerComplete();
488 "Completion writeback Addr: %#x enabled: %d\n",
490 completionAddress =
a;
497 DPRINTF(EthernetDesc,
"Completion writeback complete\n");
513 return dynamic_cast<const Params *
>(
_params);
518 void init()
override;
555 #endif //__DEV_NET_I8254XGBE_HH__ EventFunctionWrapper interEvent
void anQ(std::string sm, std::string q)
virtual long descHead() const =0
EventFunctionWrapper fetchDelayEvent
EventFunctionWrapper pktHdrEvent
Ports are used to interface objects to each other.
void hwDq(flags f, System *sys, uint64_t frame, std::string sm, std::string q, uint64_t qid, System *q_sys=NULL, int32_t count=1)
long descTail() const override
unsigned descUnused() const
Addr pciToDma(Addr pci_addr) const
IGbEInt(const std::string &name, IGbE *d)
const PortID InvalidPortID
unsigned descInBlock(unsigned num_desc)
Return the number of dsecriptors in a cache block for threshold operations.
void chkInterrupt()
Check and see if changes to the mask register have caused an interrupt to need to be sent or perhaps ...
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void serialize(CheckpointOut &cp) const override
Serialize an object.
EventFunctionWrapper tickEvent
EventFunctionWrapper pktEvent
unsigned bytesCopied
Bytes of packet that have been copied, so we know when to set EOP.
void hwQ(flags f, System *sys, uint64_t frame, std::string sm, std::string q, uint64_t qid, System *q_sys=NULL, int32_t count=1)
unsigned descLeft() const
virtual Addr descBase() const =0
void unserialize(CheckpointIn &cp) override
Unserialize an object.
virtual void fetchAfterWb()=0
void restartClock()
This function is used to restart the clock so it can handle things like draining and resume in one pl...
virtual bool recvPacket(EthPacketPtr pkt)
EventFunctionWrapper radvEvent
void hwWe(flags f, System *sys, uint64_t frame, std::string sm, std::string q, uint64_t qid, System *q_sys=NULL, int32_t count=1)
DescCache(IGbE *i, const std::string n, int s)
void writeback(Addr aMask)
Addr descBase() const override
virtual long descTail() const =0
EventFunctionWrapper wbEvent
DrainState
Object drain/handover states.
std::string annSmFetch
Annotate sm.
virtual void enableSm()=0
void hwBegin(flags f, System *sys, uint64_t frame, std::string sm, std::string st)
void wbComplete()
Called by event when dma to writeback descriptors is completed.
void updateHead(long h) override
DrainState drainState() const
Return the current drain state of an object.
void fetchAfterWb() override
void anRq(std::string sm, std::string q, int num=1)
void delayIntEvent()
Send an interrupt to the cpu.
EventFunctionWrapper pktEvent
long descHead() const override
virtual void actionAfterWb()
void drainResume() override
Resume execution after a successful drain.
void anWf(std::string sm, std::string q)
void updateHead(long h) override
void postInterrupt(iGbReg::IntTypes t, bool now=false)
Write an interrupt into the interrupt pending register and check mask and interrupt limit timer befor...
void anWe(std::string sm, std::string q)
unsigned descUsed() const
long descTail() const override
uint64_t Tick
Tick count type.
bool packetWaiting()
Ask if we are still waiting for the packet to be transfered.
void checkDrain()
Check if all the draining things that need to occur have occured and handle the drain event if so...
std::string annUnusedDescQ
void anBegin(std::string sm, std::string st, int flags=CPA::FL_NONE)
long descLen() const override
std::shared_ptr< EthPacketData > EthPacketPtr
void hwWf(flags f, System *sys, uint64_t frame, std::string sm, std::string q, uint64_t qid, System *q_sys=NULL, int32_t count=1)
virtual bool hasOutstandingEvents()
EventFunctionWrapper fetchEvent
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
EventFunctionWrapper pktDataEvent
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
void areaChanged()
If the address/len/head change when we've got descriptors that are dirty that is very bad...
Basic support for object serialization.
virtual void updateHead(long h)=0
long descLen() const override
const Params * params() const
Base Ethernet Device declaration.
DrainState drain() override
Notify an object that it needs to drain its state.
bool ethRxPkt(EthPacketPtr packet)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Addr pciToDma(Addr a)
Shortcut for DMA address translation.
IGbE(const Params *params)
void hwPq(flags f, System *sys, uint64_t frame, std::string sm, std::string q, uint64_t qid, System *q_sys=NULL, int32_t count=1)
Addr descBase() const override
bool scheduled() const
Determine if the current event is scheduled.
EventFunctionWrapper headerEvent
void completionWriteback(Addr a, bool enabled)
void fetchAfterWb() override
std::ostream CheckpointOut
unsigned int cacheBlockSize() const
void anDq(std::string sm, std::string q)
std::deque< T * > CacheType
EventFunctionWrapper wbDelayEvent
const SimObjectParams * _params
Cached copy of the object parameters.
void anPq(std::string sm, std::string q, int num=1)
std::string annUsedCacheQ
EventFunctionWrapper tadvEvent
long descHead() const override
EventFunctionWrapper tidvEvent
const uint8_t EEPROM_SIZE
void fetchDescriptors()
Fetch a chunk of descriptors into the descriptor cache.
void fetchComplete()
Called by event when dma to read descriptors is completed.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
bool packetMultiDesc()
Ask if this packet is composed of multiple descriptors so even if we've got data, we need to wait for...
EventFunctionWrapper rdtrEvent
void cpuClearInt()
Clear the interupt line to the cpu.
virtual long descLen() const =0
uint16_t flash[iGbReg::EEPROM_SIZE]
EthPacketPtr pktPtr
The packet that is currently being dmad to memory if any.
void hwRq(flags f, System *sys, uint64_t frame, std::string sm, std::string q, uint64_t qid, System *q_sys=NULL, int32_t count=1)
EventFunctionWrapper nullEvent
int splitCount
Variable to head with header/data completion events.
std::string annUnusedCacheQ
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Tick writeConfig(PacketPtr pkt) override
Write to the PCI config space data that is stored locally.