Go to the documentation of this file.
50 "weight must be a value between 0 and 1");
56 template <
typename Requestor>
65 history.push_back(std::make_pair(
id, score));
68 "Policy's maximum number of requestors is currently dictated "
69 "by the maximum number of priorities\n");
86 const double old_score,
const uint64_t served_bytes)
const
88 return ((1.0 -
weight) * old_score) + (
weight * served_bytes);
96 {
return lhs.second > rhs.second; };
103 const double served_bytes =
static_cast<double>(pkt_size);
105 uint8_t pkt_priority = 0;
106 for (
auto m_hist =
history.begin(); m_hist !=
history.end(); m_hist++) {
109 double& curr_score = m_hist->second;
111 if (curr_id == pkt_id) {
113 pkt_priority = std::distance(
history.begin(), m_hist);
115 curr_score =
updateScore(curr_score, served_bytes);
127 QoSPropFairPolicyParams::create()
uint8_t numPriorities() const
Gets the total number of priority levels in the QoS memory controller.
void initRequestor(const Requestor requestor, const double score)
std::vector< RequestorHistory > history
virtual ~PropFairPolicy()
const double weight
PF Policy weight.
double updateScore(const double old_score, const uint64_t served_bytes) const
RequestorID lookupRequestorId(const SimObject *obj) const
Looks up the RequestorID for a given SimObject returns an invalid RequestorID (invldRequestorId) if n...
Proportional Fair QoS Policy Providing a configurable fair scheduling policy based on utilization; ut...
PropFairPolicy(const Params *)
virtual uint8_t schedule(const RequestorID id, const uint64_t pkt_size) override
Schedules a packet based on proportional fair configuration.
@ invldRequestorId
Invalid requestor id for assertion checking only.
void initRequestorObj(const SimObject *requestor, const double score)
Initialize the requestor's score by providing the requestor's SimObject pointer and initial score val...
System * system() const
read the system pointer
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
MemCtrl * memCtrl
Pointer to parent memory controller implementing the policy.
void initRequestorName(const std::string requestor, const double score)
Initialize the requestor's score by providing the requestor's name and initial score value.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17