41 #ifndef __MEM_PACKET_QUEUE_HH__ 42 #define __MEM_PACKET_QUEUE_HH__ 113 {
return !transmitList.empty() && transmitList.front().tick <=
curTick(); }
142 const std::string& _sendEventName,
143 bool force_order =
false,
144 bool disable_sanity_check =
false);
158 virtual const std::string
name()
const = 0;
163 size_t size()
const {
return transmitList.size(); }
169 {
return transmitList.empty() ?
MaxTick : transmitList.front().tick; }
232 const std::string&
label)
233 {
return masterPort.
name() +
"-" +
label; }
247 const std::string _label =
"ReqPacketQueue");
268 const std::string&
label)
269 {
return masterPort.
name() +
"-" +
label; }
284 bool force_order =
false,
285 const std::string _label =
"SnoopRespPacketQueue");
306 const std::string&
label)
307 {
return slavePort.
name() +
"-" +
label; }
322 bool force_order =
false,
323 const std::string _label =
"RespPacketQueue");
334 #endif // __MEM_PACKET_QUEUE_HH__ static const std::string name(const SlavePort &slavePort, const std::string &label)
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
void disableSanityCheck()
This allows a user to explicitly disable the sanity check on the size of the transmitList, which is enabled by default.
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.
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.
static const std::string name(const MasterPort &masterPort, const std::string &label)
size_t size() const
Get the size of the queue.
A deferred packet, buffered to transmit later.
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.
Tick tick
The tick when the packet is ready to transmit.
DrainState
Object drain/handover states.
virtual ~RespPacketQueue()
Interface for objects that might require draining before checkpointing.
Tick curTick()
The current simulated tick.
const std::string name() const
Provide a name to simplify debugging.
virtual ~ReqPacketQueue()
static const std::string name(const MasterPort &masterPort, const std::string &label)
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.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
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.
const std::string name() const
Return port name (for DPRINTF).
virtual ~SnoopRespPacketQueue()
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.
DeferredPacket(Tick t, PacketPtr p)
DeferredPacketList transmitList
A list of outgoing packets.
bool trySatisfyFunctional(PacketPtr pkt)
Check the list of buffered packets against the supplied functional request.
std::list< DeferredPacket > DeferredPacketList
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.
const std::string name() const
Provide a name to simplify debugging.