/*
- * Copyright (c) 2012,2015 ARM Limited
+ * Copyright (c) 2012,2015,2018 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
void processSendEvent();
/** Event used to call processSendEvent. */
- EventWrapper<PacketQueue, &PacketQueue::processSendEvent> sendEvent;
+ EventFunctionWrapper sendEvent;
/*
* Optionally disable the sanity check
*/
bool _disableSanityCheck;
+ /**
+ * if true, inserted packets have to be unconditionally scheduled
+ * after the last packet in the queue that references the same
+ * address
+ */
+ bool forceOrder;
+
protected:
/** Label to use for print request packets label stack. */
*
* @param _em Event manager used for scheduling this queue
* @param _label Label to push on the label stack for print request packets
+ * @param force_order Force insertion order for packets with same address
* @param disable_sanity_check Flag used to disable the sanity check
* on the size of the transmitList. The check is enabled by default.
*/
PacketQueue(EventManager& _em, const std::string& _label,
+ const std::string& _sendEventName,
+ bool force_order = false,
bool disable_sanity_check = false);
/**
{ return transmitList.empty() ? MaxTick : transmitList.front().tick; }
/**
- * Check if a packets address exists in the queue.
+ * Check if a packet corresponding to the same address exists in the
+ * queue.
+ *
+ * @param pkt The packet to compare against.
+ * @param blk_size Block size in bytes.
+ * @return Whether a corresponding packet is found.
*/
- bool hasAddr(Addr addr) const;
+ bool checkConflict(const PacketPtr pkt, const int blk_size) const;
/** Check the list of buffered packets against the supplied
* functional request. */
- bool checkFunctional(PacketPtr pkt);
+ bool trySatisfyFunctional(PacketPtr pkt);
/**
* Schedule a send event if we are not already waiting for a
*
* @param pkt Packet to send
* @param when Absolute time (in ticks) to send packet
- * @param force_order Force insertion order for packets with same address
*/
- void schedSendTiming(PacketPtr pkt, Tick when, bool force_order = false);
+ void schedSendTiming(PacketPtr pkt, Tick when);
/**
* Retry sending a packet from the queue. Note that this is not
MasterPort& masterPort;
+ // Static definition so it can be called when constructing the parent
+ // without us being completely initialized.
+ static const std::string name(const MasterPort& masterPort,
+ const std::string& label)
+ { return masterPort.name() + "-" + label; }
+
public:
/**
virtual ~ReqPacketQueue() { }
const std::string name() const
- { return masterPort.name() + "-" + label; }
+ { return name(masterPort, label); }
bool sendTiming(PacketPtr pkt);
MasterPort& masterPort;
+ // Static definition so it can be called when constructing the parent
+ // without us being completely initialized.
+ static const std::string name(const MasterPort& masterPort,
+ const std::string& label)
+ { return masterPort.name() + "-" + label; }
+
public:
/**
*
* @param _em Event manager used for scheduling this queue
* @param _masterPort Master port used to send the packets
+ * @param force_order Force insertion order for packets with same address
* @param _label Label to push on the label stack for print request packets
*/
SnoopRespPacketQueue(EventManager& _em, MasterPort& _masterPort,
+ bool force_order = false,
const std::string _label = "SnoopRespPacketQueue");
virtual ~SnoopRespPacketQueue() { }
const std::string name() const
- { return masterPort.name() + "-" + label; }
+ { return name(masterPort, label); }
bool sendTiming(PacketPtr pkt);
SlavePort& slavePort;
+ // Static definition so it can be called when constructing the parent
+ // without us being completely initialized.
+ static const std::string name(const SlavePort& slavePort,
+ const std::string& label)
+ { return slavePort.name() + "-" + label; }
+
public:
/**
*
* @param _em Event manager used for scheduling this queue
* @param _slavePort Slave port used to send the packets
+ * @param force_order Force insertion order for packets with same address
* @param _label Label to push on the label stack for print request packets
*/
RespPacketQueue(EventManager& _em, SlavePort& _slavePort,
- const std::string _label = "RespPacketQueue");
+ bool force_order = false,
+ const std::string _label = "RespPacketQueue");
virtual ~RespPacketQueue() { }
const std::string name() const
- { return slavePort.name() + "-" + label; }
+ { return name(slavePort, label); }
bool sendTiming(PacketPtr pkt);