gem5 v24.0.0.0
|
QoS Memory Sink. More...
#include <mem_sink.hh>
Classes | |
class | MemoryPort |
struct | MemSinkCtrlStats |
Public Member Functions | |
MemSinkCtrl (const QoSMemSinkCtrlParams &) | |
QoS Memory Sink Constructor. | |
virtual | ~MemSinkCtrl () |
DrainState | drain () override |
Checks and return the Drain state of this SimObject. | |
Port & | getPort (const std::string &if_name, PortID=InvalidPortID) override |
Getter method to access this memory's response port. | |
void | init () override |
Initializes this object. | |
Public Member Functions inherited from gem5::memory::qos::MemCtrl | |
MemCtrl (const QoSMemCtrlParams &) | |
QoS Memory base class. | |
virtual | ~MemCtrl () |
BusState | getBusState () const |
Gets the current bus state. | |
BusState | getBusStateNext () const |
Gets the next bus state. | |
bool | hasRequestor (RequestorID id) const |
hasRequestor returns true if the selected requestor(ID) has been registered in the memory controller, which happens if the memory controller has received at least a packet from that requestor. | |
uint64_t | getReadQueueSize (const uint8_t prio) const |
Gets a READ queue size. | |
uint64_t | getWriteQueueSize (const uint8_t prio) const |
Gets a WRITE queue size. | |
uint64_t | getTotalReadQueueSize () const |
Gets the total combined READ queues size. | |
uint64_t | getTotalWriteQueueSize () const |
Gets the total combined WRITE queues size. | |
Tick | getServiceTick (const uint8_t prio) const |
Gets the last service tick related to a QoS Priority. | |
uint8_t | numPriorities () const |
Gets the total number of priority levels in the QoS memory controller. | |
System * | system () const |
read the system pointer | |
Public Member Functions inherited from gem5::ClockedObject | |
ClockedObject (const ClockedObjectParams &p) | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::SimObject | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbePoints () |
Register probe points for this object. | |
virtual void | regProbeListeners () |
Register probe listeners for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual void | startup () |
startup() is the final initialization call before simulation. | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Public Member Functions inherited from gem5::Clocked | |
void | updateClockPeriod () |
Update the tick to the current tick. | |
Tick | clockEdge (Cycles cycles=Cycles(0)) const |
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Protected Types | |
using | PacketQueue = std::deque<PacketPtr> |
The Request packets are store in a multiple dequeue structure, based on their QoS priority. | |
Protected Member Functions | |
void | processNextReqEvent () |
Processes the next Request event according to configured request latency. | |
bool | readQueueFull (const uint64_t packets) const |
Check if the read queue has room for more entries. | |
bool | writeQueueFull (const uint64_t packets) const |
Check if the write queue has room for more entries. | |
Tick | recvAtomic (PacketPtr pkt) |
Receive a Packet in Atomic mode. | |
void | recvFunctional (PacketPtr pkt) |
Receive a Packet in Functional mode. | |
bool | recvTimingReq (PacketPtr pkt) |
Receive a Packet in Timing mode. | |
Protected Member Functions inherited from gem5::memory::qos::MemCtrl | |
void | addRequestor (const RequestorID id) |
Initializes dynamically counters and statistics for a given Requestor. | |
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. | |
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. | |
template<typename Queues > | |
uint8_t | qosSchedule (std::initializer_list< Queues * > queues_ptr, uint64_t queue_entry_size, const PacketPtr pkt) |
Assign priority to a packet by executing the configured QoS policy. | |
uint8_t | schedule (RequestorID id, uint64_t data) |
uint8_t | schedule (const PacketPtr pkt) |
BusState | selectNextBusState () |
Returns next bus direction (READ or WRITE) based on configured policy. | |
void | setCurrentBusState () |
Set current bus direction (READ or WRITE) from next selected one. | |
void | recordTurnaroundStats (BusState busState, BusState busStateNext) |
Record statistics on turnarounds based on busStateNext and busState values. | |
template<typename Queues > | |
void | escalate (std::initializer_list< Queues * > queues, uint64_t queue_entry_size, RequestorID id, uint8_t tgt_prio) |
Escalates/demotes priority of all packets belonging to the passed requestor to given priority value. | |
template<typename Queues > | |
void | escalateQueues (Queues &queues, uint64_t queue_entry_size, RequestorID id, uint8_t curr_prio, uint8_t tgt_prio) |
Escalates/demotes priority of all packets belonging to the passed requestor to given priority value in a specified cluster of queues (e.g. | |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
Protected Member Functions inherited from gem5::Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. | |
void | resetClock () const |
Reset the object's clock using the current global tick value. | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. | |
Protected Attributes | |
const Tick | requestLatency |
Memory between requests latency (ticks) | |
const Tick | responseLatency |
Memory response latency (ticks) | |
const uint64_t | memoryPacketSize |
Memory packet size in bytes. | |
const uint64_t | readBufferSize |
Read request packets queue buffer size in #packets. | |
const uint64_t | writeBufferSize |
Write request packets queue buffer size in #packets. | |
MemoryPort | port |
Memory response port. | |
MemSinkInterface *const | interface |
Create pointer to interface of actual media. | |
bool | retryRdReq |
Read request pending. | |
bool | retryWrReq |
Write request pending. | |
Tick | nextRequest |
Next request service time. | |
std::vector< PacketQueue > | readQueue |
QoS-aware (per priority) incoming read requests packets queue. | |
std::vector< PacketQueue > | writeQueue |
QoS-aware (per priority) incoming read requests packets queue. | |
MemberEventWrapper<&MemSinkCtrl::processNextReqEvent > | nextReqEvent |
Event wrapper to schedule next request handler function. | |
MemSinkCtrlStats | stats |
Protected Attributes inherited from gem5::memory::qos::MemCtrl | |
const std::unique_ptr< Policy > | policy |
QoS Policy, assigns QoS priority to the incoming packets. | |
const std::unique_ptr< TurnaroundPolicy > | turnPolicy |
QoS Bus Turnaround Policy: selects the bus direction (READ/WRITE) | |
const std::unique_ptr< QueuePolicy > | queuePolicy |
QoS Queue Policy: selects packet among same-priority queue. | |
const uint8_t | _numPriorities |
Number of configured QoS priorities. | |
const bool | qosPriorityEscalation |
Enables QoS priority escalation. | |
const bool | qosSyncroScheduler |
Enables QoS synchronized scheduling invokes the QoS scheduler on all requestors, at every packet arrival. | |
std::unordered_map< RequestorID, const std::string > | requestors |
Hash of requestor ID - requestor name. | |
std::unordered_map< RequestorID, std::vector< uint64_t > > | packetPriorities |
Hash of requestors - number of packets queued per priority. | |
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. | |
std::vector< Tick > | serviceTick |
Vector of QoS priorities/last service time. | |
std::vector< uint64_t > | readQueueSizes |
Read request packets queue length in #packets, per QoS priority. | |
std::vector< uint64_t > | writeQueueSizes |
Write request packets queue length in #packets, per QoS priority. | |
uint64_t | totalReadQueueSize |
Total read request packets queue length in #packets. | |
uint64_t | totalWriteQueueSize |
Total write request packets queue length in #packets. | |
BusState | busState |
Bus state used to control the read/write switching and drive the scheduling of the next request. | |
BusState | busStateNext |
bus state for next request event triggered | |
gem5::memory::qos::MemCtrl::MemCtrlStats | stats |
System * | _system |
Pointer to the System object. | |
Protected Attributes inherited from gem5::SimObject | |
const SimObjectParams & | _params |
Cached copy of the object parameters. | |
Protected Attributes inherited from gem5::EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
Additional Inherited Members | |
Public Types inherited from gem5::memory::qos::MemCtrl | |
enum | BusState { READ , WRITE } |
Bus Direction. More... | |
Public Types inherited from gem5::ClockedObject | |
using | Params = ClockedObjectParams |
Parameters of ClockedObject. | |
Public Types inherited from gem5::SimObject | |
typedef SimObjectParams | Params |
Static Public Member Functions inherited from gem5::SimObject | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Public Attributes inherited from gem5::ClockedObject | |
PowerState * | powerState |
QoS Memory Sink.
The QoS Memory Sink is a lightweight memory controller with QoS support. It is meant to provide a QoS aware simple memory system without the need of using a complex DRAM memory controller
Definition at line 74 of file mem_sink.hh.
|
protected |
The Request packets are store in a multiple dequeue structure, based on their QoS priority.
Definition at line 81 of file mem_sink.hh.
gem5::memory::qos::MemSinkCtrl::MemSinkCtrl | ( | const QoSMemSinkCtrlParams & | p | ) |
QoS Memory Sink Constructor.
p | QoS Memory Sink configuration parameters |
Definition at line 56 of file mem_sink.cc.
References interface, gem5::memory::qos::MemCtrl::numPriorities(), readQueue, gem5::memory::qos::MemSinkInterface::setMemCtrl(), and writeQueue.
|
virtual |
Definition at line 74 of file mem_sink.cc.
|
overridevirtual |
Checks and return the Drain state of this SimObject.
Implements gem5::Drainable.
Definition at line 332 of file mem_sink.cc.
References DPRINTF, gem5::Drained, gem5::Draining, gem5::memory::qos::MemCtrl::totalReadQueueSize, and gem5::memory::qos::MemCtrl::totalWriteQueueSize.
|
overridevirtual |
Getter method to access this memory's response port.
if_name | interface name |
idx | port ID number |
Reimplemented from gem5::SimObject.
Definition at line 123 of file mem_sink.cc.
References gem5::SimObject::getPort(), interface, and port.
|
overridevirtual |
Initializes this object.
Reimplemented from gem5::SimObject.
Definition at line 78 of file mem_sink.cc.
References gem5::SimObject::init(), gem5::Port::isConnected(), port, and gem5::ResponsePort::sendRangeChange().
|
protected |
Processes the next Request event according to configured request latency.
Definition at line 212 of file mem_sink.cc.
References gem5::memory::qos::MemCtrl::_system, gem5::memory::AbstractMemory::access(), gem5::memory::qos::MemCtrl::busState, gem5::memory::qos::MemCtrl::busStateNext, gem5::curTick(), gem5::divCeil(), DPRINTF, gem5::ArmISA::e, gem5::Packet::getAddr(), gem5::System::getRequestorName(), gem5::Packet::getSize(), gem5::ArmISA::i, interface, gem5::Packet::isRead(), gem5::memory::qos::MemCtrl::logResponse(), memoryPacketSize, gem5::Packet::needsResponse(), nextReqEvent, nextRequest, gem5::memory::qos::MemCtrl::numPriorities(), panic_if, port, gem5::Packet::qosValue(), gem5::memory::qos::MemCtrl::queuePolicy, gem5::memory::qos::MemCtrl::READ, readQueue, gem5::memory::qos::MemCtrl::readQueueSizes, gem5::memory::qos::MemCtrl::recordTurnaroundStats(), gem5::Packet::req, requestLatency, responseLatency, retryRdReq, retryWrReq, gem5::QueuedResponsePort::schedTimingResp(), gem5::memory::qos::MemCtrl::schedule(), gem5::Event::scheduled(), gem5::memory::qos::MemCtrl::selectNextBusState(), gem5::ResponsePort::sendRetryReq(), gem5::memory::qos::MemCtrl::setCurrentBusState(), gem5::memory::qos::MemCtrl::totalReadQueueSize, gem5::memory::qos::MemCtrl::totalWriteQueueSize, gem5::memory::qos::MemCtrl::WRITE, writeQueue, and gem5::memory::qos::MemCtrl::writeQueueSizes.
|
inlineprotected |
Check if the read queue has room for more entries.
packets | The number of entries needed in the read queue |
Definition at line 90 of file mem_sink.cc.
References readBufferSize, and gem5::memory::qos::MemCtrl::totalReadQueueSize.
Referenced by recvTimingReq().
Receive a Packet in Atomic mode.
pkt | pointer to memory packet |
Definition at line 102 of file mem_sink.cc.
References gem5::memory::AbstractMemory::access(), gem5::Packet::cacheResponding(), interface, panic_if, and responseLatency.
|
protected |
Receive a Packet in Functional mode.
pkt | pointer to memory packet |
Definition at line 113 of file mem_sink.cc.
References gem5::memory::AbstractMemory::functionalAccess(), interface, gem5::Named::name(), gem5::Packet::popLabel(), and gem5::Packet::pushLabel().
|
protected |
Receive a Packet in Timing mode.
pkt | pointer to memory packet |
Definition at line 133 of file mem_sink.cc.
References gem5::memory::qos::MemCtrl::_system, gem5::Packet::cacheResponding(), gem5::Packet::cmdString(), gem5::curTick(), gem5::divCeil(), DPRINTF, gem5::Packet::getAddr(), gem5::System::getRequestorName(), gem5::Packet::getSize(), gem5::Packet::isRead(), gem5::Packet::isWrite(), gem5::memory::qos::MemCtrl::logRequest(), memoryPacketSize, nextReqEvent, nextRequest, gem5::memory::qos::MemSinkCtrl::MemSinkCtrlStats::numReadRetries, gem5::memory::qos::MemSinkCtrl::MemSinkCtrlStats::numWriteRetries, panic_if, gem5::memory::qos::MemCtrl::qosSchedule(), gem5::Packet::qosValue(), gem5::memory::qos::MemCtrl::queuePolicy, gem5::memory::qos::MemCtrl::READ, readQueue, readQueueFull(), gem5::Packet::req, retryRdReq, retryWrReq, gem5::memory::qos::MemCtrl::schedule(), gem5::Event::scheduled(), stats, gem5::memory::qos::MemCtrl::WRITE, writeQueue, and writeQueueFull().
|
inlineprotected |
Check if the write queue has room for more entries.
packets | The number of entries needed in the write queue |
Definition at line 96 of file mem_sink.cc.
References gem5::memory::qos::MemCtrl::totalWriteQueueSize, and writeBufferSize.
Referenced by recvTimingReq().
|
protected |
Create pointer to interface of actual media.
Definition at line 186 of file mem_sink.hh.
Referenced by getPort(), MemSinkCtrl(), processNextReqEvent(), recvAtomic(), and recvFunctional().
|
protected |
Memory packet size in bytes.
Definition at line 172 of file mem_sink.hh.
Referenced by processNextReqEvent(), and recvTimingReq().
|
protected |
Event wrapper to schedule next request handler function.
Definition at line 225 of file mem_sink.hh.
Referenced by processNextReqEvent(), and recvTimingReq().
|
protected |
Next request service time.
Definition at line 195 of file mem_sink.hh.
Referenced by processNextReqEvent(), and recvTimingReq().
|
protected |
Memory response port.
Definition at line 181 of file mem_sink.hh.
Referenced by getPort(), init(), and processNextReqEvent().
|
protected |
Read request packets queue buffer size in #packets.
Definition at line 175 of file mem_sink.hh.
Referenced by readQueueFull().
|
protected |
QoS-aware (per priority) incoming read requests packets queue.
Definition at line 211 of file mem_sink.hh.
Referenced by MemSinkCtrl(), processNextReqEvent(), and recvTimingReq().
|
protected |
Memory between requests latency (ticks)
Definition at line 166 of file mem_sink.hh.
Referenced by processNextReqEvent().
|
protected |
Memory response latency (ticks)
Definition at line 169 of file mem_sink.hh.
Referenced by processNextReqEvent(), and recvAtomic().
|
protected |
Read request pending.
Definition at line 189 of file mem_sink.hh.
Referenced by processNextReqEvent(), and recvTimingReq().
|
protected |
Write request pending.
Definition at line 192 of file mem_sink.hh.
Referenced by processNextReqEvent(), and recvTimingReq().
|
protected |
Definition at line 266 of file mem_sink.hh.
Referenced by recvTimingReq().
|
protected |
Write request packets queue buffer size in #packets.
Definition at line 178 of file mem_sink.hh.
Referenced by writeQueueFull().
|
protected |
QoS-aware (per priority) incoming read requests packets queue.
Definition at line 216 of file mem_sink.hh.
Referenced by MemSinkCtrl(), processNextReqEvent(), and recvTimingReq().