46#ifndef __MEM_RUBY_NETWORK_MESSAGEBUFFER_HH__
47#define __MEM_RUBY_NETWORK_MESSAGEBUFFER_HH__
54#include <unordered_map>
58#include "debug/RubyQueue.hh"
65#include "params/MessageBuffer.hh"
97 std::greater<MsgPtr>());
107 DPRINTF(RubyQueue,
"Setting consumer: %s\n", *consumer);
109 fatal(
"Trying to connect %s to MessageBuffer %s. \
110 \n%s already connected. Check the cntrl_id's.\n",
127 bool bypassStrictFIFO =
false);
156 void print(std::ostream& out)
const;
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Ports are used to interface objects to each other.
Abstract superclass for simulation objects.
statistics::Scalar m_stall_count
bool isDeferredMsgMapEmpty(Addr addr) const
void setConsumer(Consumer *consumer)
void recycle(Tick current_time, Tick recycle_latency)
MessageBuffer(const Params &p)
bool areNSlotsAvailable(unsigned int n, Tick curTime)
void setIncomingLink(int link_id)
bool isReady(Tick current_time) const
Tick m_time_last_time_enqueue
int getIncomingLink() const
Port & getPort(const std::string &, PortID idx=InvalidPortID) override
Get a port with a given name and index.
const Message * peek() const
Function for extracting the message at the head of the message queue.
const bool m_allow_zero_latency
unsigned int m_size_last_time_size_checked
void unregisterDequeueCallback()
bool m_last_message_strict_fifo_bypassed
void enqueueDeferredMessages(Addr addr, Tick curTime, Tick delay)
unsigned int getStallMapSize()
std::unordered_map< Addr, std::vector< MsgPtr > > DeferredMsgMapType
A map from line addresses to corresponding vectors of messages that are deferred for enqueueing.
int routingPriority() const
void enqueue(MsgPtr message, Tick curTime, Tick delta, bool bypassStrictFIFO=false)
const unsigned int m_max_dequeue_rate
When != 0, isReady returns false once m_max_dequeue_rate messages have been dequeued in the same cycl...
MessageBufferParams Params
bool functionalRead(Packet *pkt)
const unsigned int m_max_size
The maximum capacity.
void reanalyzeAllMessages(Tick current_time)
unsigned int m_stalled_at_cycle_start
unsigned int m_msgs_this_cycle
statistics::Formula m_avg_stall_time
Consumer * m_consumer
Consumer to signal a wakeup(), can be NULL.
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 retur...
statistics::Average m_buf_msgs
statistics::Scalar m_stall_time
bool hasStalledMsg(Addr addr) const
std::map< Addr, std::list< MsgPtr > > StallMsgMapType
std::vector< MsgPtr > m_prio_heap
void delayHead(Tick current_time, Tick delta)
const MsgPtr & peekMsgPtr() const
Tick m_time_last_time_pop
void deferEnqueueingMessage(Addr addr, MsgPtr message)
void registerDequeueCallback(std::function< void()> callback)
StallMsgMapType m_stall_msg_map
A map from line addresses to lists of stalled messages for that line.
Tick m_time_last_time_size_checked
void stallMessage(Addr addr, Tick current_time)
statistics::Scalar m_msg_count
unsigned int m_size_at_cycle_start
statistics::Formula m_occupancy
void setPriority(int rank)
unsigned int m_dequeues_this_cy
void print(std::ostream &out) const
void reanalyzeMessages(Addr addr, Tick current_time)
const MessageRandomization m_randomization
void reanalyzeList(std::list< MsgPtr > &, Tick)
unsigned int getSize(Tick curTime)
int m_stall_map_size
Current size of the stall map.
statistics::Scalar m_not_avail_count
std::function< void()> m_dequeue_callback
uint32_t functionalAccess(Packet *pkt, bool is_read, WriteMask *mask)
const int m_routing_priority
uint32_t functionalWrite(Packet *pkt)
DeferredMsgMapType m_deferred_msg_map
bool functionalRead(Packet *pkt, WriteMask &mask)
static RubyDummyPort & instance()
A stat that calculates the per tick average of a value.
This is a simple scalar statistic, like a counter.
#define fatal(...)
This implements a cprintf based fatal() function.
std::shared_ptr< Message > MsgPtr
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
Declaration of the Packet class.