Go to the documentation of this file.
57 turnPolicy(
p.qos_turnaround_policy),
59 _numPriorities(
p.qos_priorities),
60 qosPriorityEscalation(
p.qos_priority_escalation),
61 qosSyncroScheduler(
p.qos_syncro_scheduler),
62 totalReadQueueSize(0), totalWriteQueueSize(0),
63 busState(READ), busStateNext(READ),
99 "qos::MemCtrl::logRequest REQUESTOR %s [id %d] address %#x"
100 " prio %d this requestor q packets %d"
101 " - queue size %d - requested entries %d\n",
109 }
else if (dir ==
WRITE) {
115 for (
auto j = 0;
j < entries; ++
j) {
131 "qos::MemCtrl::logRequest REQUESTOR %s [id %d]"
132 " registering priority distance %d for priority %d"
140 "qos::MemCtrl::logRequest REQUESTOR %s [id %d] prio %d "
141 "this requestor q packets %d - new queue size %d\n",
149 Addr addr, uint64_t entries,
double delay)
152 "Logging response with invalid requestor\n");
155 "qos::MemCtrl::logResponse REQUESTOR %s [id %d] address %#x prio"
156 " %d this requestor q packets %d"
157 " - queue size %d - requested entries %d\n",
165 }
else if (dir ==
WRITE) {
171 "qos::MemCtrl::logResponse requestor %s negative packets "
176 for (
auto j = 0;
j < entries; ++
j) {
179 "qos::MemCtrl::logResponse requestor %s unmatched response "
183 uint64_t requestTime = it->second.front();
186 it->second.pop_front();
189 if (it->second.empty()) {
193 double latency = (double) (
curTick() + delay - requestTime)
210 "qos::MemCtrl::logResponse REQUESTOR %s [id %d] prio %d "
211 "this requestor q packets %d - new queue size %d\n",
223 "qos::MemCtrl::schedule requestor id [%d] "
224 "data received [%d], but QoS scheduler not initialized\n",
238 DPRINTF(QOS,
"qos::MemCtrl::schedule Packet received [Qv %d], "
239 "but QoS scheduler not initialized\n",
252 "qos::MemCtrl::selectNextBusState running policy %s\n",
258 "qos::MemCtrl::selectNextBusState running "
259 "default bus direction selection policy\n");
281 "qos::MemCtrl::addRequestor registering"
282 " Requestor %s [id %d]\n",
288 : statistics::
Group(&mc),
292 "Average QoS priority value for accepted requests"),
293 ADD_STAT(avgPriorityDistance, statistics::units::
Count::get(),
294 "Average QoS priority distance between assigned and queued "
297 ADD_STAT(priorityMinLatency, statistics::units::Second::get(),
298 "per QoS priority minimum request to response latency"),
299 ADD_STAT(priorityMaxLatency, statistics::units::Second::get(),
300 "per QoS priority maximum request to response latency"),
301 ADD_STAT(numReadWriteTurnArounds, statistics::units::
Count::get(),
302 "Number of turnarounds from READ to WRITE"),
303 ADD_STAT(numWriteReadTurnArounds, statistics::units::
Count::get(),
304 "Number of turnarounds from WRITE to READ"),
306 "Number of times bus staying in READ state"),
308 "Number of times bus staying in WRITE state")
317 using namespace statistics;
321 const auto num_priorities = memCtrl.numPriorities();
325 .init(max_requestors)
331 .init(max_requestors)
336 .init(num_priorities)
341 .init(num_priorities)
345 for (
int i = 0;
i < max_requestors;
i++) {
347 avgPriority.subname(
i,
name);
348 avgPriorityDistance.subname(
i,
name);
351 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.
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
void recordTurnaroundStats(BusState busState, BusState busStateNext)
Record statistics on turnarounds based on busStateNext and busState values.
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
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 Sun Jul 30 2023 01:56:58 for gem5 by doxygen 1.8.17