summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/MessageBuffer.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/network/MessageBuffer.hh')
-rw-r--r--src/mem/ruby/network/MessageBuffer.hh44
1 files changed, 17 insertions, 27 deletions
diff --git a/src/mem/ruby/network/MessageBuffer.hh b/src/mem/ruby/network/MessageBuffer.hh
index 3ced44250..d47284eb1 100644
--- a/src/mem/ruby/network/MessageBuffer.hh
+++ b/src/mem/ruby/network/MessageBuffer.hh
@@ -41,20 +41,19 @@
#include <string>
#include <vector>
+#include "debug/RubyQueue.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/slicc_interface/Message.hh"
#include "mem/packet.hh"
+#include "params/MessageBuffer.hh"
+#include "sim/sim_object.hh"
-class MessageBuffer
+class MessageBuffer : public SimObject
{
public:
- MessageBuffer(const std::string &name = "");
-
- std::string name() const { return m_name; }
-
- void setRecycleLatency(Cycles recycle_latency)
- { m_recycle_latency = recycle_latency; }
+ typedef MessageBufferParams Params;
+ MessageBuffer(const Params *p);
void reanalyzeMessages(const Address& addr);
void reanalyzeAllMessages();
@@ -78,6 +77,7 @@ class MessageBuffer
void setPriority(int rank) { m_priority_rank = rank; }
void setConsumer(Consumer* consumer)
{
+ DPRINTF(RubyQueue, "Setting consumer: %s\n", *consumer);
if (m_consumer != NULL) {
fatal("Trying to connect %s to MessageBuffer %s. \
\n%s already connected. Check the cntrl_id's.\n",
@@ -88,21 +88,22 @@ class MessageBuffer
void setSender(ClockedObject* obj)
{
+ DPRINTF(RubyQueue, "Setting sender: %s\n", obj->name());
assert(m_sender == NULL || m_sender == obj);
m_sender = obj;
}
void setReceiver(ClockedObject* obj)
{
+ DPRINTF(RubyQueue, "Setting receiver: %s\n", obj->name());
assert(m_receiver == NULL || m_receiver == obj);
m_receiver = obj;
}
- void setDescription(const std::string& name) { m_name = name; }
- std::string getDescription() { return m_name;}
-
Consumer* getConsumer() { return m_consumer; }
+ bool getOrdered() { return m_strict_fifo; }
+
//! Function for extracting the message at the head of the
//! message queue. The function assumes that the queue is nonempty.
const Message* peek() const;
@@ -126,16 +127,7 @@ class MessageBuffer
bool isStallMapEmpty() { return m_stall_msg_map.size() == 0; }
unsigned int getStallMapSize() { return m_stall_msg_map.size(); }
- void
- setOrdering(bool order)
- {
- m_strict_fifo = order;
- m_ordering_set = true;
- }
-
- void resize(unsigned int size) { m_max_size = size; }
unsigned int getSize();
- void setRandomization(bool random_flag) { m_randomization = random_flag; }
void clear();
void print(std::ostream& out) const;
@@ -156,12 +148,12 @@ class MessageBuffer
uint32_t functionalWrite(Packet *pkt);
private:
+ //added by SS
+ const Cycles m_recycle_latency;
+
void reanalyzeList(std::list<MsgPtr> &, Tick);
private:
- //added by SS
- Cycles m_recycle_latency;
-
// Data Members (m_ prefix)
//! The two ends of the buffer.
ClockedObject* m_sender;
@@ -176,9 +168,8 @@ class MessageBuffer
typedef std::map< Address, std::list<MsgPtr> > StallMsgMapType;
StallMsgMapType m_stall_msg_map;
- std::string m_name;
- unsigned int m_max_size;
+ const unsigned int m_max_size;
Cycles m_time_last_time_size_checked;
unsigned int m_size_last_time_size_checked;
@@ -195,9 +186,8 @@ class MessageBuffer
// slots available
uint64 m_msg_counter;
int m_priority_rank;
- bool m_strict_fifo;
- bool m_ordering_set;
- bool m_randomization;
+ const bool m_strict_fifo;
+ const bool m_randomization;
int m_input_link_id;
int m_vnet_id;