35 #ifndef __DEV_NET_I8254XGBE_HH__
36 #define __DEV_NET_I8254XGBE_HH__
43 #include "debug/EthernetDesc.hh"
44 #include "debug/EthernetIntr.hh"
51 #include "params/IGbE.hh"
96 "Posting RXT interrupt because RDTR timer expired\n");
107 "Posting RXT interrupt because RADV timer expired\n");
118 "Posting TXDW interrupt because TADV timer expired\n");
129 "Posting TXDW interrupt because TIDV timer expired\n");
186 void anQ(std::string
sm, std::string
q) {
196 void anPq(std::string
sm, std::string
q,
int num = 1) {
201 void anRq(std::string
sm, std::string
q,
int num = 1) {
224 virtual long descLen()
const = 0;
494 "Completion writeback Addr: %#x enabled: %d\n",
503 DPRINTF(EthernetDesc,
"Completion writeback complete\n");
524 void init()
override;
560 #endif //__DEV_NET_I8254XGBE_HH__
void anQ(std::string sm, std::string q)
virtual long descHead() const =0
EventWrapper< RxDescCache,&RxDescCache::pktSplitDone > pktHdrEvent
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)
void processContextDesc()
long descTail() const override
void pktComplete()
Called by event when dma to write packet is completed.
unsigned descUsed() const
IGbEInt(const std::string &name, IGbE *d)
unsigned descInBlock(unsigned num_desc)
Return the number of dsecriptors in a cache block for threshold operations.
DrainState
Object drain/handover states.
void chkInterrupt()
Check and see if changes to the mask register have caused an interrupt to need to be sent or perhaps ...
void serialize(CheckpointOut &cp) const override
Serialize an object.
TxDescCache(IGbE *i, std::string n, int s)
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)
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)
EventWrapper< DescCache,&DescCache::writeback1 > wbDelayEvent
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)
bool packetDone()
Check if the dma on the packet has completed and RX state machine can continue.
void writeback(Addr aMask)
Addr descBase() const override
virtual long descTail() const =0
Addr pciToDma(Addr pci_addr) const
std::string annSmFetch
Annotate sm.
EventWrapper< TxDescCache,&TxDescCache::nullCallback > nullEvent
EventWrapper< TxDescCache,&TxDescCache::pktComplete > pktEvent
virtual void enableSm()=0
void hwBegin(flags f, System *sys, uint64_t frame, std::string sm, std::string st)
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...
void wbComplete()
Called by event when dma to writeback descriptors is completed.
void updateHead(long h) override
void fetchAfterWb() override
void anRq(std::string sm, std::string q, int num=1)
void delayIntEvent()
Send an interrupt to the cpu.
void serialize(CheckpointOut &cp) const override
Serialize an object.
long descHead() const override
virtual void actionAfterWb()
EtherInt * getEthPort(const std::string &if_name, int idx) override
Additional function to return the Port of a memory object.
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)
EventWrapper< IGbE,&IGbE::delayIntEvent > interEvent
long descTail() const override
EventWrapper< DescCache,&DescCache::wbComplete > wbEvent
uint64_t Tick
Tick count type.
bool packetWaiting()
Ask if we are still waiting for the packet to be transfered.
EventWrapper< RxDescCache,&RxDescCache::pktComplete > pktEvent
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)
EventWrapper< DescCache,&DescCache::fetchComplete > fetchEvent
unsigned int cacheBlockSize() const
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)
void pktComplete()
Called by event when dma to write packet is completed.
virtual bool hasOutstandingEvents()
EventWrapper< DescCache,&DescCache::fetchDescriptors1 > fetchDelayEvent
EventWrapper< IGbE,&IGbE::tick > tickEvent
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
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.
RxDescCache(IGbE *i, std::string n, int s)
virtual void updateHead(long h)=0
long descLen() const override
void serialize(CheckpointOut &cp) const override
Serialize an object.
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 hasOutstandingEvents() override
void actionAfterWb() override
EventWrapper< TxDescCache,&TxDescCache::headerComplete > headerEvent
void completionWriteback(Addr a, bool enabled)
void fetchAfterWb() override
unsigned descUnused() const
unsigned descLeft() const
std::ostream CheckpointOut
void anDq(std::string sm, std::string q)
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...
EventWrapper< RxDescCache,&RxDescCache::pktSplitDone > pktDataEvent
void unserialize(CheckpointIn &cp) override
Unserialize an object.
std::deque< T * > CacheType
EventWrapper< IGbE,&IGbE::tidvProcess > tidvEvent
const Params * params() const
const SimObjectParams * _params
Cached copy of the object parameters.
EventWrapper< IGbE,&IGbE::rdtrProcess > rdtrEvent
void anPq(std::string sm, std::string q, int num=1)
std::string annUsedCacheQ
const std::string & name() const
Return port name (for DPRINTF).
long descHead() const override
DrainState drainState() const
Return the current drain state of an object.
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.
The base EtherObject class, allows for an accesor function to a simobj that returns the Port...
EventWrapper< IGbE,&IGbE::tadvProcess > tadvEvent
bool packetMultiDesc()
Ask if this packet is composed of multiple descriptors so even if we've got data, we need to wait for...
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.
bool packetAvailable()
Ask if the packet has been transfered so the state machine can give it to the fifo.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
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)
void getPacketData(EthPacketPtr p)
EventWrapper< IGbE,&IGbE::radvProcess > radvEvent
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.
bool hasOutstandingEvents() override
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.