Go to the documentation of this file.
46 policy(
p->qos_policy),
47 turnPolicy(
p->qos_turnaround_policy),
49 _numPriorities(
p->qos_priorities),
50 qosPriorityEscalation(
p->qos_priority_escalation),
51 qosSyncroScheduler(
p->qos_syncro_scheduler),
52 totalReadQueueSize(0), totalWriteQueueSize(0),
53 busState(READ), busStateNext(READ),
89 "QoSMemCtrl::logRequest REQUESTOR %s [id %d] address %d"
90 " prio %d this requestor q packets %d"
91 " - queue size %d - requested entries %d\n",
99 }
else if (dir ==
WRITE) {
105 for (
auto j = 0;
j < entries; ++
j) {
121 "QoSMemCtrl::logRequest REQUESTOR %s [id %d]"
122 " registering priority distance %d for priority %d"
130 "QoSMemCtrl::logRequest REQUESTOR %s [id %d] prio %d "
131 "this requestor q packets %d - new queue size %d\n",
139 Addr addr, uint64_t entries,
double delay)
142 "Logging response with invalid requestor\n");
145 "QoSMemCtrl::logResponse REQUESTOR %s [id %d] address %d prio"
146 " %d this requestor q packets %d"
147 " - queue size %d - requested entries %d\n",
155 }
else if (dir ==
WRITE) {
161 "QoSMemCtrl::logResponse requestor %s negative packets "
166 for (
auto j = 0;
j < entries; ++
j) {
169 "QoSMemCtrl::logResponse requestor %s unmatched response for"
173 uint64_t requestTime = it->second.front();
176 it->second.pop_front();
179 if (it->second.empty()) {
183 double latency = (double) (
curTick() + delay - requestTime)
200 "QoSMemCtrl::logResponse REQUESTOR %s [id %d] prio %d "
201 "this requestor q packets %d - new queue size %d\n",
213 "QoSScheduler::schedule requestor id [%d] "
214 "data received [%d], but QoS scheduler not initialized\n",
228 DPRINTF(QOS,
"QoSScheduler::schedule Packet received [Qv %d], "
229 "but QoS scheduler not initialized\n",
242 "QoSMemoryTurnaround::selectBusState running policy %s\n",
248 "QoSMemoryTurnaround::selectBusState running "
249 "default bus direction selection policy\n");
271 "QoSMemCtrl::addRequestor registering"
272 " Requestor %s [id %d]\n",
282 "Average QoS priority value for accepted requests"),
284 "Average QoS priority distance between assigned and "
288 "per QoS priority minimum request to response latency (s)"),
290 "per QoS priority maximum request to response latency (s)"),
292 "Number of turnarounds from READ to WRITE"),
294 "Number of turnarounds from WRITE to READ"),
296 "Number of times bus staying in READ state"),
298 "Number of times bus staying in WRITE state")
307 using namespace Stats;
311 const auto num_priorities = memCtrl.numPriorities();
315 .init(max_requestors)
321 .init(max_requestors)
326 .init(num_priorities)
331 .init(num_priorities)
335 for (
int i = 0;
i < max_requestors;
i++) {
337 avgPriority.subname(
i,
name);
338 avgPriorityDistance.subname(
i,
name);
341 for (
int j = 0;
j < num_priorities; ++
j) {
virtual void regStats()
Callback to set stat parameters.
BusState getBusState() const
Gets the current bus state.
Stats::VectorStandardDeviation avgPriority
per-requestor average QoS priority
double s
These variables equal the number of ticks in the unit of time they're named after in a double.
std::unordered_map< RequestorID, std::unordered_map< uint64_t, std::deque< uint64_t > > > requestTimes
Hash of requestors - address of request - queue of times of request.
The QoS::MemCtrl is a base class for Memory objects which support QoS - it provides access to a set o...
QoS::MemCtrl::MemCtrlStats stats
uint8_t schedule(RequestorID id, uint64_t data)
void recordTurnaroundStats()
Record statistics on turnarounds based on busStateNext and busState values.
Stats::Vector priorityMaxLatency
per-priority maximum latency
const std::unique_ptr< Policy > policy
QoS Policy, assigns QoS priority to the incoming packets.
uint8_t numPriorities() const
Gets the total number of priority levels in the QoS memory controller.
const std::string to_string(sc_enc enc)
RequestPtr req
A pointer to the original request.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
MemCtrl(const QoSMemCtrlParams *)
QoS Memory base class.
void logResponse(BusState dir, RequestorID id, uint8_t qos, Addr addr, uint64_t entries, double delay)
Called upon receiving a response, updates statistics and updates queues status.
uint64_t totalWriteQueueSize
Total write request packets queue length in #packets.
uint8_t qosValue() const
QoS Value getter Returns 0 if QoS value was never set (constructor default).
void regStats() override
Callback to set stat parameters.
std::unordered_map< RequestorID, std::vector< uint64_t > > packetPriorities
Hash of requestors - number of packets queued per priority.
void logRequest(BusState dir, RequestorID id, uint8_t qos, Addr addr, uint64_t entries)
Called upon receiving a request or updates statistics and updates queues status.
BusState busStateNext
bus state for next request event triggered
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
void addRequestor(const RequestorID id)
Initializes dynamically counters and statistics for a given Requestor.
System * _system
Pointer to the System object.
uint64_t totalReadQueueSize
Total read request packets queue length in #packets.
bool hasRequestor(RequestorID id) const
hasRequestor returns true if the selected requestor(ID) has been registered in the memory controller,...
Stats::Scalar numStayReadState
Count the number of times bus staying in READ state.
uint64_t getTotalReadQueueSize() const
Gets the total combined READ queues size.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Stats::Scalar numWriteReadTurnArounds
Count the number of turnarounds WRITE to READ.
std::vector< uint64_t > readQueueSizes
Read request packets queue length in #packets, per QoS priority.
const FlagsType nozero
Don't print if this is zero.
Stats::VectorStandardDeviation avgPriorityDistance
per-requestor average QoS distance between assigned and queued values
Stats::Scalar numReadWriteTurnArounds
Count the number of turnarounds READ to WRITE.
Stats::Vector priorityMinLatency
per-priority minimum latency
virtual const std::string name() const
const std::unique_ptr< TurnaroundPolicy > turnPolicy
QoS Bus Turnaround Policy: selects the bus direction (READ/WRITE)
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
std::vector< Tick > serviceTick
Vector of QoS priorities/last service time.
RequestorID maxRequestors()
Get the number of requestors registered in the system.
MemCtrlStats(MemCtrl &mc)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t getTotalWriteQueueSize() const
Gets the total combined WRITE queues size.
std::string getRequestorName(RequestorID requestor_id)
Get the name of an object for a given request id.
System * system() const
read the system pointer
std::unordered_map< RequestorID, const std::string > requestors
Hash of requestor ID - requestor name.
void value(VCounter &vec) const
Stats::Scalar numStayWriteState
Count the number of times bus staying in WRITE state.
const std::unique_ptr< QueuePolicy > queuePolicy
QoS Queue Policy: selects packet among same-priority queue.
BusState busState
Bus state used to control the read/write switching and drive the scheduling of the next request.
BusState selectNextBusState()
Returns next bus direction (READ or WRITE) based on configured policy.
const FlagsType nonan
Don't print if this is NAN.
const uint8_t _numPriorities
Number of configured QoS priorities.
Tick curTick()
The current simulated tick.
std::vector< uint64_t > writeQueueSizes
Write request packets queue length in #packets, per QoS priority.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17