Go to the documentation of this file.
58 turnPolicy(
p.qos_turnaround_policy),
60 _numPriorities(
p.qos_priorities),
61 qosPriorityEscalation(
p.qos_priority_escalation),
62 qosSyncroScheduler(
p.qos_syncro_scheduler),
63 totalReadQueueSize(0), totalWriteQueueSize(0),
64 busState(READ), busStateNext(READ),
100 "qos::MemCtrl::logRequest REQUESTOR %s [id %d] address %#x"
101 " prio %d this requestor q packets %d"
102 " - queue size %d - requested entries %d\n",
110 }
else if (dir ==
WRITE) {
116 for (
auto j = 0;
j < entries; ++
j) {
132 "qos::MemCtrl::logRequest REQUESTOR %s [id %d]"
133 " registering priority distance %d for priority %d"
141 "qos::MemCtrl::logRequest REQUESTOR %s [id %d] prio %d "
142 "this requestor q packets %d - new queue size %d\n",
150 Addr addr, uint64_t entries,
double delay)
153 "Logging response with invalid requestor\n");
156 "qos::MemCtrl::logResponse REQUESTOR %s [id %d] address %#x prio"
157 " %d this requestor q packets %d"
158 " - queue size %d - requested entries %d\n",
166 }
else if (dir ==
WRITE) {
172 "qos::MemCtrl::logResponse requestor %s negative packets "
177 for (
auto j = 0;
j < entries; ++
j) {
180 "qos::MemCtrl::logResponse requestor %s unmatched response "
184 uint64_t requestTime = it->second.front();
187 it->second.pop_front();
190 if (it->second.empty()) {
194 double latency = (double) (
curTick() + delay - requestTime)
211 "qos::MemCtrl::logResponse REQUESTOR %s [id %d] prio %d "
212 "this requestor q packets %d - new queue size %d\n",
224 "qos::MemCtrl::schedule requestor id [%d] "
225 "data received [%d], but QoS scheduler not initialized\n",
239 DPRINTF(QOS,
"qos::MemCtrl::schedule Packet received [Qv %d], "
240 "but QoS scheduler not initialized\n",
253 "qos::MemCtrl::selectNextBusState running policy %s\n",
259 "qos::MemCtrl::selectNextBusState running "
260 "default bus direction selection policy\n");
282 "qos::MemCtrl::addRequestor registering"
283 " Requestor %s [id %d]\n",
289 : statistics::
Group(&mc),
292 ADD_STAT(avgPriority, statistics::units::Count::get(),
293 "Average QoS priority value for accepted requests"),
294 ADD_STAT(avgPriorityDistance, statistics::units::Count::get(),
295 "Average QoS priority distance between assigned and queued "
298 ADD_STAT(priorityMinLatency, statistics::units::Second::get(),
299 "per QoS priority minimum request to response latency"),
300 ADD_STAT(priorityMaxLatency, statistics::units::Second::get(),
301 "per QoS priority maximum request to response latency"),
302 ADD_STAT(numReadWriteTurnArounds, statistics::units::Count::get(),
303 "Number of turnarounds from READ to WRITE"),
304 ADD_STAT(numWriteReadTurnArounds, statistics::units::Count::get(),
305 "Number of turnarounds from WRITE to READ"),
306 ADD_STAT(numStayReadState, statistics::units::Count::get(),
307 "Number of times bus staying in READ state"),
308 ADD_STAT(numStayWriteState, statistics::units::Count::get(),
309 "Number of times bus staying in WRITE state")
318 using namespace statistics;
322 const auto num_priorities = memCtrl.numPriorities();
326 .init(max_requestors)
332 .init(max_requestors)
337 .init(num_priorities)
342 .init(num_priorities)
346 for (
int i = 0;
i < max_requestors;
i++) {
348 avgPriority.subname(
i,
name);
349 avgPriorityDistance.subname(
i,
name);
352 for (
int j = 0;
j < num_priorities; ++
j) {
Tick curTick()
The universal simulation clock.
uint64_t totalReadQueueSize
Total read request packets queue length in #packets.
const std::unique_ptr< QueuePolicy > queuePolicy
QoS Queue Policy: selects packet among same-priority queue.
statistics::Scalar numWriteReadTurnArounds
Count the number of turnarounds WRITE to READ.
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.
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.
const uint8_t _numPriorities
Number of configured QoS priorities.
statistics::VectorStandardDeviation avgPriorityDistance
per-requestor average QoS distance between assigned and queued values
void addRequestor(const RequestorID id)
Initializes dynamically counters and statistics for a given Requestor.
RequestPtr req
A pointer to the original request.
System * _system
Pointer to the System object.
const FlagsType nozero
Don't print if this is zero.
const std::string to_string(sc_enc enc)
uint8_t qosValue() const
QoS Value getter Returns 0 if QoS value was never set (constructor default).
statistics::Scalar numReadWriteTurnArounds
Count the number of turnarounds READ to WRITE.
std::vector< uint64_t > readQueueSizes
Read request packets queue length in #packets, per QoS priority.
statistics::Scalar numStayWriteState
Count the number of times bus staying in WRITE state.
MemCtrl(const QoSMemCtrlParams &)
QoS Memory base class.
GEM5_DEPRECATED_NAMESPACE(QoS, qos)
const FlagsType nonan
Don't print if this is NAN.
std::vector< uint64_t > writeQueueSizes
Write request packets queue length in #packets, per QoS priority.
uint64_t getTotalWriteQueueSize() const
Gets the total combined WRITE queues size.
BusState busStateNext
bus state for next request event triggered
BusState busState
Bus state used to control the read/write switching and drive the scheduling of the next request.
bool hasRequestor(RequestorID id) const
hasRequestor returns true if the selected requestor(ID) has been registered in the memory controller,...
void value(VCounter &vec) const
const std::unique_ptr< TurnaroundPolicy > turnPolicy
QoS Bus Turnaround Policy: selects the bus direction (READ/WRITE)
uint8_t schedule(RequestorID id, uint64_t data)
RequestorID maxRequestors()
Get the number of requestors registered in the system.
virtual std::string name() const
BusState selectNextBusState()
Returns next bus direction (READ or WRITE) based on configured policy.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::string getRequestorName(RequestorID requestor_id)
Get the name of an object for a given request id.
gem5::memory::qos::MemCtrl::MemCtrlStats stats
System * system() const
read the system pointer
uint64_t totalWriteQueueSize
Total write request packets queue length in #packets.
statistics::VectorStandardDeviation avgPriority
per-requestor average QoS priority
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual void regStats()
Callback to set stat parameters.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void regStats() override
Callback to set stat parameters.
#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.
uint64_t getTotalReadQueueSize() const
Gets the total combined READ queues size.
const std::unique_ptr< Policy > policy
QoS Policy, assigns QoS priority to the incoming packets.
BusState getBusState() const
Gets the current bus state.
std::unordered_map< RequestorID, std::vector< uint64_t > > packetPriorities
Hash of requestors - number of packets queued per priority.
uint8_t numPriorities() const
Gets the total number of priority levels in the QoS memory controller.
statistics::Vector priorityMinLatency
per-priority minimum latency
void recordTurnaroundStats()
Record statistics on turnarounds based on busStateNext and busState values.
MemCtrlStats(MemCtrl &mc)
The qos::MemCtrl is a base class for Memory objects which support QoS - it provides access to a set o...
std::unordered_map< RequestorID, const std::string > requestors
Hash of requestor ID - requestor name.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
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.
statistics::Scalar numStayReadState
Count the number of times bus staying in READ state.
statistics::Vector priorityMaxLatency
per-priority maximum latency
double s
These variables equal the number of ticks in the unit of time they're named after in a double.
Generated on Tue Feb 8 2022 11:47:11 for gem5 by doxygen 1.8.17