40 #include <unordered_map>
45 #include "debug/QOS.hh"
46 #include "enums/QoSQPolicy.hh"
62 switch (
p.qos_q_policy) {
63 case enums::QoSQPolicy::fifo:
65 case enums::QoSQPolicy::lrg:
67 case enums::QoSQPolicy::lifo:
73 QueuePolicy::PacketQueue::iterator
76 QueuePolicy::PacketQueue::iterator ret =
q->end();
79 std::unordered_map<RequestorID, QueuePolicy::PacketQueue::iterator> track;
82 for (
auto pkt_it =
q->begin(); pkt_it !=
q->end(); ++pkt_it) {
84 const auto& pkt = *pkt_it;
87 "QoSQPolicy::lrg detected packet without request");
91 DPRINTF(QOS,
"QoSQPolicy::lrg checking packet "
92 "from queue with id %d\n", requestor_id);
96 "%s: Unrecognized Requestor\n", __func__);
99 "%s: toServe list is empty\n", __func__);
101 if (
toServe.front() == requestor_id) {
102 DPRINTF(QOS,
"QoSQPolicy::lrg matched to served "
103 "requestor id %d\n", requestor_id);
106 toServe.push_back(requestor_id);
117 if (track.find(requestor_id) == track.end()) {
118 track[requestor_id] = pkt_it;
119 DPRINTF(QOS,
"QoSQPolicy::lrg tracking a packet for "
120 "requestor id %d\n", requestor_id);
126 for (
const auto& requestorId :
toServe) {
127 DPRINTF(QOS,
"QoSQPolicy::lrg evaluating alternative "
128 "requestor id %d\n", requestorId);
130 if (track.find(requestorId) != track.end()) {
131 ret = track[requestorId];
132 DPRINTF(QOS,
"QoSQPolicy::lrg requestor id "
133 "%d selected for service\n", requestorId);
139 DPRINTF(QOS,
"QoSQPolicy::lrg no packet was serviced\n");
151 toServe.push_back(requestor_id);
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
RequestorID requestorId() const
First In First Out Queue Policy.
Last In First Out Queue Policy.
Least Recently Granted Queue Policy It selects packets from the queue with a round robin-like policy:...
void enqueuePacket(PacketPtr pkt) override
This method is called by the memory controller after it enqueues a packet.
PacketQueue::iterator selectPacket(PacketQueue *queue) override
Implements LRG packet select policy.
std::list< RequestorID > toServe
Support structure for lrg algorithms: keeps track of serviced requestors, always serve the front elem...
bool hasRequestor(RequestorID id) const
hasRequestor returns true if the selected requestor(ID) has been registered in the memory controller,...
static QueuePolicy * create(const QoSMemCtrlParams &p)
This factory method is used for generating the queue policy.
MemCtrl * memCtrl
Pointer to parent memory controller implementing the policy.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
GEM5_DEPRECATED_NAMESPACE(QoS, qos)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Declaration of a request, the overall memory request consisting of the parts of the request that are ...