Go to the documentation of this file.
42 #include <unordered_map>
45 #include "debug/QOS.hh"
46 #include "enums/QoSQPolicy.hh"
54 switch (
p->qos_q_policy) {
55 case Enums::QoSQPolicy::fifo:
57 case Enums::QoSQPolicy::lrg:
59 case Enums::QoSQPolicy::lifo:
65 QueuePolicy::PacketQueue::iterator
68 QueuePolicy::PacketQueue::iterator ret =
q->end();
71 std::unordered_map<RequestorID, QueuePolicy::PacketQueue::iterator> track;
74 for (
auto pkt_it =
q->begin(); pkt_it !=
q->end(); ++pkt_it) {
76 const auto& pkt = *pkt_it;
79 "QoSQPolicy::lrg detected packet without request");
83 DPRINTF(QOS,
"QoSQPolicy::lrg checking packet "
84 "from queue with id %d\n", requestor_id);
88 "%s: Unrecognized Requestor\n", __func__);
91 "%s: toServe list is empty\n", __func__);
93 if (
toServe.front() == requestor_id) {
94 DPRINTF(QOS,
"QoSQPolicy::lrg matched to served "
95 "requestor id %d\n", requestor_id);
98 toServe.push_back(requestor_id);
109 if (track.find(requestor_id) == track.end()) {
110 track[requestor_id] = pkt_it;
111 DPRINTF(QOS,
"QoSQPolicy::lrg tracking a packet for "
112 "requestor id %d\n", requestor_id);
118 for (
const auto& requestorId :
toServe) {
119 DPRINTF(QOS,
"QoSQPolicy::lrg evaluating alternative "
120 "requestor id %d\n", requestorId);
122 if (track.find(requestorId) != track.end()) {
123 ret = track[requestorId];
124 DPRINTF(QOS,
"QoSQPolicy::lrg requestor id "
125 "%d selected for service\n", requestorId);
131 DPRINTF(QOS,
"QoSQPolicy::lrg no packet was serviced\n");
143 toServe.push_back(requestor_id);
void enqueuePacket(PacketPtr pkt) override
This method is called by the memory controller after it enqueues a packet.
Least Recently Granted Queue Policy It selects packets from the queue with a round robin-like policy:...
RequestorID requestorId() const
MemCtrl * memCtrl
Pointer to parent memory controller implementing the policy.
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.
std::list< RequestorID > toServe
Support structure for lrg algorithms: keeps track of serviced requestors, always serve the front elem...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Last In First Out Queue Policy.
First In First Out Queue Policy.
PacketQueue::iterator selectPacket(PacketQueue *queue) override
Implements LRG packet select policy.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17