47 #include "debug/Drain.hh"
48 #include "debug/PacketQueue.hh"
53 bool disable_sanity_check)
54 :
em(_em), sendEvent(this), _disableSanityCheck(disable_sanity_check),
55 label(_label), waitingOnRetry(false)
78 if (
p.pkt->getAddr() ==
addr)
120 panic(
"Packet queue %s has grown beyond 100 packets\n",
146 !(force_order &&
i->pkt->getAddr() == pkt->
getAddr()))
167 when = std::max(when,
curTick() + 1);
183 DPRINTF(Drain,
"PacketQueue done draining,"
184 "processing drain event\n");
233 DPRINTF(Drain,
"PacketQueue not drained\n");
239 const std::string _label)
240 :
PacketQueue(_em, _label), masterPort(_masterPort)
252 const std::string _label)
253 :
PacketQueue(_em, _label), masterPort(_masterPort)
264 const std::string _label)
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
DrainState drain() override
Notify an object that it needs to drain its state.
RespPacketQueue(EventManager &_em, SlavePort &_slavePort, const std::string _label="RespPacketQueue")
Create a response packet queue, linked to an event manager, a slave port, and a label that will be us...
void retry()
Retry sending a packet from the queue.
bool hasAddr(Addr addr) const
Check if a packets address exists in the queue.
PacketPtr pkt
Pointer to the packet to transmit.
Declaration of a simple PacketQueue that is associated with a port on which it attempts to send packe...
void schedSendTiming(PacketPtr pkt, Tick when, bool force_order=false)
Add a packet to the transmit list, and schedule a send event.
EventWrapper< PacketQueue,&PacketQueue::processSendEvent > sendEvent
Event used to call processSendEvent.
DrainState
Object drain/handover states.
bool waitingOnRetry
Remember whether we're awaiting a retry.
bool sendTimingSnoopResp(PacketPtr pkt)
Attempt to send a timing snoop response packet to the slave port by calling its corresponding receive...
bool isExpressSnoop() const
bool scheduled() const
Determine if the current event is scheduled.
A deferred packet, buffered to transmit later.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the slave port by calling its corresponding receive function...
A SlavePort is a specialisation of a port.
void schedSendEvent(Tick when)
Schedule a send event if we are not already waiting for a retry.
ReqPacketQueue(EventManager &_em, MasterPort &_masterPort, const std::string _label="ReqPacketQueue")
Create a request packet queue, linked to an event manager, a master port, and a label that will be us...
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
bool deferredPacketReady() const
Check whether we have a packet ready to go on the transmit list.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the master port by calling its corresponding receive function...
Tick curTick()
The current simulated tick.
Tick when() const
Get the time that the event is scheduled.
uint64_t Tick
Tick count type.
virtual bool sendTiming(PacketPtr pkt)=0
Send a packet using the appropriate method for the specific subclass (reuest, response or snoop respo...
EventManager & em
The manager which is used for the event queue.
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
Tick deferredPacketReadyTime() const
Get the next packet ready time.
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (reuest, response or snoop respo...
bool checkFunctional(PacketPtr pkt)
Check the list of buffered packets against the supplied functional request.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Draining buffers pending serialization/handover.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (reuest, response or snoop respo...
bool checkFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
void reschedule(Event &event, Tick when, bool always=false)
A packet queue is a class that holds deferred packets and later sends them using the associated slave...
void processSendEvent()
Used to schedule sending of deferred packets.
virtual ~PacketQueue()
Virtual desctructor since the class may be used as a base class.
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
virtual const std::string name() const =0
Provide a name to simplify debugging.
void signalDrainDone() const
Signal that an object is drained.
void schedule(Event &event, Tick when)
DrainState drainState() const
Return the current drain state of an object.
DeferredPacketList transmitList
A list of outgoing packets.
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (reuest, response or snoop respo...
SnoopRespPacketQueue(EventManager &_em, MasterPort &_masterPort, const std::string _label="SnoopRespPacketQueue")
Create a snoop response packet queue, linked to an event manager, a master port, and a label that wil...
PacketQueue(EventManager &_em, const std::string &_label, bool disable_sanity_check=false)
Create a packet queue, linked to an event manager, and a label that will be used for functional print...
virtual void sendDeferredPacket()
Attempt to send a packet.
const std::string label
Label to use for print request packets label stack.