44#include "debug/Drain.hh"
45#include "debug/PacketQueue.hh"
51 const std::string& _sendEventName,
53 bool disable_sanity_check)
55 _disableSanityCheck(disable_sanity_check),
56 forceOrder(force_order),
57 label(_label), waitingOnRetry(
false)
80 if (
p.pkt->matchBlockAddr(pkt, blk_size))
122 panic(
"Packet queue %s has grown beyond 1024 packets\n",
141 if ((
forceOrder && it->pkt->matchAddr(pkt)) || it->tick <= when) {
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)
241 memSidePort(_mem_side_port)
254 const std::string _label)
256 memSidePort(_mem_side_port)
269 const std::string _label)
271 cpuSidePort(_cpu_side_port)
A deferred packet, buffered to transmit later.
A packet queue is a class that holds deferred packets and later sends them using the associated CPU-s...
bool waitingOnRetry
Remember whether we're awaiting a retry.
bool forceOrder
if true, inserted packets have to be unconditionally scheduled after the last packet in the queue tha...
EventManager & em
The manager which is used for the event queue.
bool trySatisfyFunctional(PacketPtr pkt)
Check the list of buffered packets against the supplied functional request.
void processSendEvent()
Used to schedule sending of deferred packets.
bool deferredPacketReady() const
Check whether we have a packet ready to go on the transmit list.
DeferredPacketList transmitList
A list of outgoing packets.
const std::string label
Label to use for print request packets label stack.
EventFunctionWrapper sendEvent
Event used to call processSendEvent.
void retry()
Retry sending a packet from the queue.
virtual bool sendTiming(PacketPtr pkt)=0
Send a packet using the appropriate method for the specific subclass (request, response or snoop resp...
void schedSendTiming(PacketPtr pkt, Tick when)
Add a packet to the transmit list, and schedule a send event.
virtual const std::string name() const =0
Provide a name to simplify debugging.
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...
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
bool checkConflict(const PacketPtr pkt, const int blk_size) const
Check if a packet corresponding to the same address exists in the queue.
virtual void sendDeferredPacket()
Attempt to send a packet.
void schedSendEvent(Tick when)
Schedule a send event if we are not already waiting for a retry.
virtual ~PacketQueue()
Virtual desctructor since the class may be used as a base class.
Tick deferredPacketReadyTime() const
Get the next packet ready time.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
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).
bool isExpressSnoop() const
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (request, response or snoop resp...
ReqPacketQueue(EventManager &_em, RequestPort &_mem_side_port, const std::string _label="ReqPacketQueue")
Create a request packet queue, linked to an event manager, a memory-side port, and a label that will ...
RequestPort & memSidePort
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
bool sendTimingSnoopResp(PacketPtr pkt)
Attempt to send a timing snoop response packet to the response port by calling its corresponding rece...
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (request, response or snoop resp...
ResponsePort & cpuSidePort
RespPacketQueue(EventManager &_em, ResponsePort &_cpu_side_port, bool force_order=false, const std::string _label="RespPacketQueue")
Create a response packet queue, linked to an event manager, a CPU-side port, and a label that will be...
A ResponsePort is a specialization of a port.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
RequestPort & memSidePort
SnoopRespPacketQueue(EventManager &_em, RequestPort &_mem_side_port, bool force_order=false, const std::string _label="SnoopRespPacketQueue")
Create a snoop response packet queue, linked to an event manager, a memory-side port,...
bool sendTiming(PacketPtr pkt)
Send a packet using the appropriate method for the specific subclass (request, response or snoop resp...
void signalDrainDone() const
Signal that an object is drained.
DrainState drainState() const
Return the current drain state of an object.
DrainState
Object drain/handover states.
@ Draining
Draining buffers pending serialization/handover.
@ Drained
Buffers drained, ready for serialization/handover.
bool scheduled() const
Determine if the current event is scheduled.
void schedule(Event &event, Tick when)
void reschedule(Event &event, Tick when, bool always=false)
Tick when() const
Get the time that the event is scheduled.
#define panic(...)
This implements a cprintf based panic() function.
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Tick
Tick count type.
Declaration of a simple PacketQueue that is associated with a port on which it attempts to send packe...
const std::string & name()