44 #include "debug/Drain.hh" 45 #include "debug/PacketQueue.hh" 48 const std::string& _sendEventName,
50 bool disable_sanity_check)
77 if (
p.pkt->matchBlockAddr(pkt, blk_size))
119 panic(
"Packet queue %s has grown beyond 100 packets\n",
138 if ((
forceOrder && it->pkt->matchAddr(pkt)) || it->tick <= when) {
164 when = std::max(when,
curTick() + 1);
180 DPRINTF(Drain,
"PacketQueue done draining," 181 "processing drain event\n");
230 DPRINTF(Drain,
"PacketQueue not drained\n");
236 const std::string _label)
238 masterPort(_masterPort)
251 const std::string _label)
265 const std::string _label)
267 slavePort(_slavePort)
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
#define panic(...)
This implements a cprintf based panic() function.
DrainState drain() override
Notify an object that it needs to drain its state.
void retry()
Retry sending a packet from 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...
bool isExpressSnoop() const
bool forceOrder
if true, inserted packets have to be unconditionally scheduled after the last packet in the queue tha...
void schedSendTiming(PacketPtr pkt, Tick when)
Add a packet to the transmit list, and schedule a send event.
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...
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.
EventFunctionWrapper sendEvent
Event used to call processSendEvent.
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).
DrainState
Object drain/handover states.
DrainState drainState() const
Return the current drain state of an object.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the master port by calling its corresponding receive function...
Draining buffers pending serialization/handover.
Tick curTick()
The current simulated tick.
const std::string name() const
Provide a name to simplify debugging.
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.
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
RespPacketQueue(EventManager &_em, SlavePort &_slavePort, bool force_order=false, 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 schedule(Event &event, Tick when)
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (reuest, response or snoop respo...
void reschedule(Event &event, Tick when, bool always=false)
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...
SnoopRespPacketQueue(EventManager &_em, MasterPort &_masterPort, bool force_order=false, const std::string _label="SnoopRespPacketQueue")
Create a snoop response packet queue, linked to an event manager, a master port, and a label that wil...
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
bool scheduled() const
Determine if the current event is scheduled.
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.
PacketQueue(EventManager &_em, const std::string &_label, const std::string &_sendEventName, bool force_order=false, bool disable_sanity_check=false)
Create a packet queue, linked to an event manager, and a label that will be used for functional print...
bool deferredPacketReady() const
Check whether we have a packet ready to go on the transmit list.
virtual ~PacketQueue()
Virtual desctructor since the class may be used as a base class.
virtual const std::string name() const =0
Provide a name to simplify debugging.
void signalDrainDone() const
Signal that an object is drained.
Tick deferredPacketReadyTime() const
Get the next packet ready time.
bool checkConflict(const PacketPtr pkt, const int blk_size) const
Check if a packet corresponding to the same address exists in the queue.
DeferredPacketList transmitList
A list of outgoing packets.
bool trySatisfyFunctional(PacketPtr pkt)
Check the list of buffered packets against the supplied functional request.
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (reuest, response or snoop respo...
Tick when() const
Get the time that the event is scheduled.
virtual void sendDeferredPacket()
Attempt to send a packet.
const std::string label
Label to use for print request packets label stack.
const std::string name() const
Provide a name to simplify debugging.