gem5
[DEVELOP-FOR-23.0]
|
#include <MessageBuffer.hh>
Public Types | |
typedef MessageBufferParams | Params |
![]() | |
typedef SimObjectParams | Params |
Public Member Functions | |
MessageBuffer (const Params &p) | |
void | reanalyzeMessages (Addr addr, Tick current_time) |
void | reanalyzeAllMessages (Tick current_time) |
void | stallMessage (Addr addr, Tick current_time) |
bool | hasStalledMsg (Addr addr) const |
bool | isReady (Tick current_time) const |
Tick | readyTime () const |
void | delayHead (Tick current_time, Tick delta) |
bool | areNSlotsAvailable (unsigned int n, Tick curTime) |
int | getPriority () |
void | setPriority (int rank) |
void | setConsumer (Consumer *consumer) |
Consumer * | getConsumer () |
bool | getOrdered () |
const Message * | peek () const |
Function for extracting the message at the head of the message queue. More... | |
const MsgPtr & | peekMsgPtr () const |
void | enqueue (MsgPtr message, Tick curTime, Tick delta) |
void | deferEnqueueingMessage (Addr addr, MsgPtr message) |
void | enqueueDeferredMessages (Addr addr, Tick curTime, Tick delay) |
bool | isDeferredMsgMapEmpty (Addr addr) const |
Tick | dequeue (Tick current_time, bool decrement_messages=true) |
Updates the delay cycles of the message at the head of the queue, removes it from the queue and returns its total delay. More... | |
void | registerDequeueCallback (std::function< void()> callback) |
void | unregisterDequeueCallback () |
void | recycle (Tick current_time, Tick recycle_latency) |
bool | isEmpty () const |
bool | isStallMapEmpty () |
unsigned int | getStallMapSize () |
unsigned int | getSize (Tick curTime) |
void | clear () |
void | print (std::ostream &out) const |
void | clearStats () |
void | setIncomingLink (int link_id) |
void | setVnet (int net) |
int | getIncomingLink () const |
int | getVnet () const |
Port & | getPort (const std::string &, PortID idx=InvalidPortID) override |
Get a port with a given name and index. More... | |
uint32_t | functionalWrite (Packet *pkt) |
bool | functionalRead (Packet *pkt) |
bool | functionalRead (Packet *pkt, WriteMask &mask) |
int | routingPriority () const |
![]() | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | init () |
init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
![]() | |
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. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
![]() | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
![]() | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
![]() | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. More... | |
virtual void | resetStats () |
Callback to reset stats. More... | |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (statistics::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
![]() | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Private Types | |
typedef std::map< Addr, std::list< MsgPtr > > | StallMsgMapType |
typedef std::unordered_map< Addr, std::vector< MsgPtr > > | DeferredMsgMapType |
A map from line addresses to corresponding vectors of messages that are deferred for enqueueing. More... | |
Private Member Functions | |
void | reanalyzeList (std::list< MsgPtr > &, Tick) |
uint32_t | functionalAccess (Packet *pkt, bool is_read, WriteMask *mask) |
Additional Inherited Members | |
![]() | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More... | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More... | |
![]() | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. More... | |
![]() | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
![]() | |
const SimObjectParams & | _params |
Cached copy of the object parameters. More... | |
![]() | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Definition at line 74 of file MessageBuffer.hh.
|
private |
A map from line addresses to corresponding vectors of messages that are deferred for enqueueing.
Messages in this map are waiting to be enqueued into the message buffer.
Definition at line 232 of file MessageBuffer.hh.
typedef MessageBufferParams gem5::ruby::MessageBuffer::Params |
Definition at line 77 of file MessageBuffer.hh.
|
private |
Definition at line 210 of file MessageBuffer.hh.
gem5::ruby::MessageBuffer::MessageBuffer | ( | const Params & | p | ) |
Definition at line 60 of file MessageBuffer.cc.
References gem5::statistics::DataWrap< Derived, InfoProxyType >::flags(), m_avg_stall_time, m_buf_msgs, m_consumer, m_dequeue_callback, m_input_link_id, m_max_size, m_msg_count, m_msg_counter, m_msgs_this_cycle, m_not_avail_count, m_occupancy, m_priority_rank, m_size_at_cycle_start, m_size_last_time_size_checked, m_stall_count, m_stall_msg_map, m_stall_time, m_stalled_at_cycle_start, m_vnet_id, gem5::statistics::nonan, and gem5::statistics::nozero.
bool gem5::ruby::MessageBuffer::areNSlotsAvailable | ( | unsigned int | n, |
Tick | curTime | ||
) |
Definition at line 147 of file MessageBuffer.cc.
References DPRINTF, m_max_size, m_msgs_this_cycle, m_not_avail_count, m_prio_heap, m_size_at_cycle_start, m_stall_map_size, m_stalled_at_cycle_start, m_time_last_time_enqueue, m_time_last_time_pop, and gem5::ArmISA::n.
Referenced by gem5::ruby::Throttle::operateVnet().
void gem5::ruby::MessageBuffer::clear | ( | ) |
Definition at line 354 of file MessageBuffer.cc.
References m_msg_counter, m_msgs_this_cycle, m_prio_heap, m_size_at_cycle_start, m_stalled_at_cycle_start, m_time_last_time_enqueue, and m_time_last_time_pop.
|
inline |
Definition at line 156 of file MessageBuffer.hh.
References m_msg_counter, and m_not_avail_count.
Definition at line 469 of file MessageBuffer.cc.
References gem5::X86ISA::addr, DPRINTF, and m_deferred_msg_map.
Definition at line 93 of file MessageBuffer.hh.
References enqueue(), gem5::VegaISA::m, and m_prio_heap.
Updates the delay cycles of the message at the head of the queue, removes it from the queue and returns its total delay.
Definition at line 299 of file MessageBuffer.cc.
References gem5::curTick(), DPRINTF, isReady(), m_buf_msgs, m_dequeue_callback, m_dequeues_this_cy, m_msg_count, m_prio_heap, m_size_at_cycle_start, m_stall_map_size, m_stall_time, m_stalled_at_cycle_start, and m_time_last_time_pop.
Referenced by gem5::ruby::PerfectSwitch::operateMessageBuffer(), gem5::ruby::Throttle::operateVnet(), and stallMessage().
Definition at line 217 of file MessageBuffer.cc.
References DPRINTF, gem5::ruby::Message::getLastEnqueueTime(), gem5::ruby::RubySystem::getRandomization(), gem5::ruby::RubySystem::getWarmupEnabled(), m_allow_zero_latency, m_buf_msgs, m_consumer, m_last_arrival_time, m_max_size, m_msg_counter, m_msgs_this_cycle, m_prio_heap, m_randomization, m_stall_map_size, m_strict_fifo, m_time_last_time_enqueue, m_vnet_id, gem5::Named::name(), panic, panic_if, gem5::ruby::random_time(), gem5::ruby::Consumer::scheduleEventAbsolute(), gem5::ruby::Message::setLastEnqueueTime(), gem5::ruby::Message::setMsgCounter(), gem5::ruby::Consumer::storeEventInfo(), and gem5::ruby::Message::updateDelayedTicks().
Referenced by delayHead(), enqueueDeferredMessages(), gem5::ruby::VIPERCoalescer::invTCP(), gem5::ruby::DMASequencer::issueNext(), gem5::ruby::VIPERCoalescer::issueRequest(), gem5::ruby::Sequencer::issueRequest(), gem5::ruby::DMASequencer::makeRequest(), and gem5::ruby::Throttle::operateVnet().
Definition at line 477 of file MessageBuffer.cc.
References gem5::X86ISA::addr, enqueue(), isDeferredMsgMapEmpty(), gem5::VegaISA::m, and m_deferred_msg_map.
|
private |
Definition at line 537 of file MessageBuffer.cc.
References DPRINTF, gem5::ruby::Message::functionalRead(), gem5::ruby::Message::functionalWrite(), gem5::Packet::getAddr(), gem5::ArmISA::i, m_prio_heap, m_stall_msg_map, and gem5::mask().
Referenced by functionalRead(), and functionalWrite().
|
inline |
Definition at line 182 of file MessageBuffer.hh.
References functionalAccess().
Referenced by gem5::ruby::AbstractController::functionalMemoryRead().
Definition at line 188 of file MessageBuffer.hh.
References functionalAccess(), and gem5::mask().
|
inline |
Definition at line 173 of file MessageBuffer.hh.
References functionalAccess().
|
inline |
Definition at line 116 of file MessageBuffer.hh.
References m_consumer.
|
inline |
Definition at line 161 of file MessageBuffer.hh.
References m_input_link_id.
Referenced by gem5::ruby::PerfectSwitch::operateMessageBuffer().
|
inline |
Definition at line 118 of file MessageBuffer.hh.
References m_strict_fifo.
|
inlineoverridevirtual |
Get a port with a given name and index.
This is used at binding time and returns a reference to a protocol-agnostic port.
gem5 has a request and response port interface. All memory objects are connected together via ports. These ports provide a rigid interface between these memory objects. These ports implement three different memory system modes: timing, atomic, and functional. The most important mode is the timing mode and here timing mode is used for conducting cycle-level timing experiments. The other modes are only used in special circumstances and should not be used to conduct cycle-level timing experiments. The other modes are only used in special circumstances. These ports allow SimObjects to communicate with each other.
if_name | Port name |
idx | Index in the case of a VectorPort |
Reimplemented from gem5::SimObject.
Definition at line 165 of file MessageBuffer.hh.
References gem5::ruby::RubyDummyPort::instance().
|
inline |
Definition at line 103 of file MessageBuffer.hh.
References m_priority_rank.
unsigned int gem5::ruby::MessageBuffer::getSize | ( | Tick | curTime | ) |
Definition at line 136 of file MessageBuffer.cc.
References m_prio_heap, m_size_last_time_size_checked, and m_time_last_time_size_checked.
|
inline |
Definition at line 150 of file MessageBuffer.hh.
References m_stall_msg_map.
|
inline |
Definition at line 162 of file MessageBuffer.hh.
References m_vnet_id.
bool gem5::ruby::MessageBuffer::hasStalledMsg | ( | Addr | addr | ) | const |
Definition at line 463 of file MessageBuffer.cc.
References gem5::X86ISA::addr, and m_stall_msg_map.
bool gem5::ruby::MessageBuffer::isDeferredMsgMapEmpty | ( | Addr | addr | ) | const |
Definition at line 493 of file MessageBuffer.cc.
References gem5::X86ISA::addr, and m_deferred_msg_map.
Referenced by enqueueDeferredMessages().
|
inline |
Definition at line 148 of file MessageBuffer.hh.
References m_prio_heap.
bool gem5::ruby::MessageBuffer::isReady | ( | Tick | current_time | ) | const |
Definition at line 512 of file MessageBuffer.cc.
References m_consumer, m_dequeues_this_cy, m_max_dequeue_rate, m_prio_heap, m_time_last_time_pop, and gem5::ruby::Consumer::scheduleEvent().
Referenced by dequeue(), gem5::ruby::PerfectSwitch::operateMessageBuffer(), gem5::ruby::Throttle::operateVnet(), recycle(), and stallMessage().
|
inline |
Definition at line 149 of file MessageBuffer.hh.
References m_stall_msg_map.
const Message * gem5::ruby::MessageBuffer::peek | ( | ) | const |
Function for extracting the message at the head of the message queue.
The function assumes that the queue is nonempty.
Definition at line 194 of file MessageBuffer.cc.
References DPRINTF, and m_prio_heap.
|
inline |
Definition at line 124 of file MessageBuffer.hh.
References m_prio_heap.
Referenced by gem5::ruby::PerfectSwitch::operateMessageBuffer(), and gem5::ruby::Throttle::operateVnet().
void gem5::ruby::MessageBuffer::print | ( | std::ostream & | out | ) | const |
Definition at line 499 of file MessageBuffer.cc.
References gem5::ccprintf(), m_consumer, m_prio_heap, and gem5::Named::name().
Referenced by gem5::ruby::operator<<().
Tick gem5::ruby::MessageBuffer::readyTime | ( | ) | const |
Definition at line 528 of file MessageBuffer.cc.
References m_prio_heap, and gem5::MaxTick.
Referenced by gem5::ruby::PerfectSwitch::operateVnet().
void gem5::ruby::MessageBuffer::reanalyzeAllMessages | ( | Tick | current_time | ) |
Definition at line 421 of file MessageBuffer.cc.
References DPRINTF, m_stall_map_size, m_stall_msg_map, and reanalyzeList().
Definition at line 383 of file MessageBuffer.cc.
References DPRINTF, gem5::PowerISA::lt, gem5::VegaISA::m, m_consumer, m_prio_heap, and gem5::ruby::Consumer::scheduleEventAbsolute().
Referenced by reanalyzeAllMessages(), and reanalyzeMessages().
Definition at line 403 of file MessageBuffer.cc.
References gem5::X86ISA::addr, DPRINTF, m_stall_map_size, m_stall_msg_map, and reanalyzeList().
Referenced by gem5::ruby::AbstractController::wakeUpBuffer().
Definition at line 367 of file MessageBuffer.cc.
References DPRINTF, isReady(), m_consumer, m_prio_heap, and gem5::ruby::Consumer::scheduleEventAbsolute().
void gem5::ruby::MessageBuffer::registerDequeueCallback | ( | std::function< void()> | callback | ) |
Definition at line 342 of file MessageBuffer.cc.
References m_dequeue_callback.
|
inline |
Definition at line 193 of file MessageBuffer.hh.
References m_routing_priority.
|
inline |
Definition at line 105 of file MessageBuffer.hh.
References DPRINTF, fatal, and m_consumer.
Referenced by gem5::ruby::Throttle::addLinks(), and gem5::ruby::AbstractController::init().
|
inline |
Definition at line 158 of file MessageBuffer.hh.
References m_input_link_id.
|
inline |
Definition at line 104 of file MessageBuffer.hh.
References m_priority_rank.
|
inline |
Definition at line 159 of file MessageBuffer.hh.
References m_vnet_id.
Definition at line 441 of file MessageBuffer.cc.
References gem5::X86ISA::addr, dequeue(), DPRINTF, gem5::ruby::getOffset(), isReady(), m_prio_heap, m_stall_count, m_stall_map_size, and m_stall_msg_map.
void gem5::ruby::MessageBuffer::unregisterDequeueCallback | ( | ) |
Definition at line 348 of file MessageBuffer.cc.
References m_dequeue_callback.
|
private |
Definition at line 276 of file MessageBuffer.hh.
Referenced by enqueue().
|
private |
Definition at line 289 of file MessageBuffer.hh.
Referenced by MessageBuffer().
|
private |
Definition at line 286 of file MessageBuffer.hh.
Referenced by dequeue(), enqueue(), and MessageBuffer().
|
private |
Consumer to signal a wakeup(), can be NULL.
Definition at line 203 of file MessageBuffer.hh.
Referenced by enqueue(), getConsumer(), isReady(), MessageBuffer(), print(), reanalyzeList(), recycle(), and setConsumer().
|
private |
Definition at line 233 of file MessageBuffer.hh.
Referenced by deferEnqueueingMessage(), enqueueDeferredMessages(), and isDeferredMsgMapEmpty().
|
private |
Definition at line 206 of file MessageBuffer.hh.
Referenced by dequeue(), MessageBuffer(), registerDequeueCallback(), and unregisterDequeueCallback().
|
private |
Definition at line 257 of file MessageBuffer.hh.
|
private |
Definition at line 280 of file MessageBuffer.hh.
Referenced by getIncomingLink(), MessageBuffer(), and setIncomingLink().
|
private |
Definition at line 266 of file MessageBuffer.hh.
Referenced by enqueue().
|
private |
When != 0, isReady returns false once m_max_dequeue_rate messages have been dequeued in the same cycle.
Definition at line 255 of file MessageBuffer.hh.
Referenced by isReady().
|
private |
The maximum capacity.
For finite-sized buffers, m_max_size stores a number greater than 0 to indicate the maximum allowed number of messages in the buffer at any time. To get infinitely-sized buffers, set buffer size: m_max_size = 0
Definition at line 249 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), enqueue(), and MessageBuffer().
|
private |
Definition at line 285 of file MessageBuffer.hh.
Referenced by dequeue(), and MessageBuffer().
|
private |
Definition at line 272 of file MessageBuffer.hh.
Referenced by clear(), clearStats(), enqueue(), and MessageBuffer().
|
private |
Definition at line 270 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), clear(), enqueue(), and MessageBuffer().
|
private |
Definition at line 284 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), clearStats(), and MessageBuffer().
|
private |
Definition at line 290 of file MessageBuffer.hh.
Referenced by MessageBuffer().
|
private |
Definition at line 204 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), clear(), delayHead(), dequeue(), enqueue(), functionalAccess(), getSize(), isEmpty(), isReady(), peek(), peekMsgPtr(), print(), readyTime(), reanalyzeList(), recycle(), and stallMessage().
|
private |
Definition at line 273 of file MessageBuffer.hh.
Referenced by getPriority(), MessageBuffer(), and setPriority().
|
private |
Definition at line 275 of file MessageBuffer.hh.
Referenced by enqueue().
|
private |
Definition at line 278 of file MessageBuffer.hh.
Referenced by routingPriority().
|
private |
Definition at line 268 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), clear(), dequeue(), and MessageBuffer().
|
private |
Definition at line 260 of file MessageBuffer.hh.
Referenced by getSize(), and MessageBuffer().
|
private |
Definition at line 288 of file MessageBuffer.hh.
Referenced by MessageBuffer(), and stallMessage().
|
private |
Current size of the stall map.
Track the number of messages held in stall map lists. This is used to ensure that if the buffer is finite-sized, it blocks further requests when the m_prio_heap and m_stall_msg_map contain m_max_size messages.
Definition at line 241 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), dequeue(), enqueue(), reanalyzeAllMessages(), reanalyzeMessages(), and stallMessage().
|
private |
A map from line addresses to lists of stalled messages for that line.
If this buffer allows the receiver to stall messages, on a stall request, the stalled message is removed from the m_prio_heap and placed in the m_stall_msg_map. Messages are held there until the receiver requests they be reanalyzed, at which point they are moved back to m_prio_heap.
NOTE: The stall map holds messages in the order in which they were initially received, and when a line is unblocked, the messages are moved back to the m_prio_heap in the same order. This prevents starving older requests with younger ones.
Definition at line 225 of file MessageBuffer.hh.
Referenced by functionalAccess(), getStallMapSize(), hasStalledMsg(), isStallMapEmpty(), MessageBuffer(), reanalyzeAllMessages(), reanalyzeMessages(), and stallMessage().
|
private |
Definition at line 287 of file MessageBuffer.hh.
Referenced by dequeue(), and MessageBuffer().
|
private |
Definition at line 269 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), clear(), dequeue(), and MessageBuffer().
|
private |
Definition at line 274 of file MessageBuffer.hh.
Referenced by enqueue(), and getOrdered().
|
private |
Definition at line 264 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), clear(), and enqueue().
|
private |
Definition at line 265 of file MessageBuffer.hh.
Referenced by areNSlotsAvailable(), clear(), dequeue(), and isReady().
|
private |
Definition at line 259 of file MessageBuffer.hh.
Referenced by getSize().
|
private |
Definition at line 281 of file MessageBuffer.hh.
Referenced by enqueue(), getVnet(), MessageBuffer(), and setVnet().