summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-02-23 00:58:40 -0500
committerKorey Sewell <ksewell@umich.edu>2011-02-23 00:58:40 -0500
commit67cc52a6056e17ff5bc9e0da60e1e498a5dc2c1b (patch)
tree1c9036bf240e80a618a4691f1b9b1486270dc444
parent63a25a56ccc93c24703fec87f830c833974e7060 (diff)
downloadgem5-67cc52a6056e17ff5bc9e0da60e1e498a5dc2c1b.tar.xz
ruby: cleaning up RubyQueue and RubyNetwork dprintfs
Overall, continue to progress Ruby debug messages to more of the normal M5 debug message style - add a name() to the Ruby Throttle & PerfectSwitch objects so that the debug output isn't littered w/"global:" everywhere. - clean up messages that print over multiple lines when possible - clean up duplicate prints in the message buffer
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.cc32
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.hh2
-rw-r--r--src/mem/ruby/common/NetDest.hh4
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.cc12
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.hh4
-rw-r--r--src/mem/ruby/network/simple/Throttle.cc3
-rw-r--r--src/mem/ruby/network/simple/Throttle.hh4
7 files changed, 31 insertions, 30 deletions
diff --git a/src/mem/ruby/buffers/MessageBuffer.cc b/src/mem/ruby/buffers/MessageBuffer.cc
index 225595005..793e28857 100644
--- a/src/mem/ruby/buffers/MessageBuffer.cc
+++ b/src/mem/ruby/buffers/MessageBuffer.cc
@@ -125,8 +125,8 @@ MessageBuffer::getMsgPtrCopy() const
const Message*
MessageBuffer::peekAtHeadOfQueue() const
{
- DPRINTF(RubyQueue, "Peeking at head of queue %s time: %lld\n",
- m_name, g_eventQueue_ptr->getTime());
+ DPRINTF(RubyQueue, "Peeking at head of queue time: %lld\n",
+ g_eventQueue_ptr->getTime());
assert(isReady());
const Message* msg_ptr = m_prio_heap.front().m_msgptr.get();
@@ -151,9 +151,6 @@ random_time()
void
MessageBuffer::enqueue(MsgPtr message, Time delta)
{
- DPRINTF(RubyQueue, "Enqueue %s time: %lld, message: %s.\n",
- m_name, g_eventQueue_ptr->getTime(), (*(message.get())));
-
m_msg_counter++;
m_size++;
@@ -222,10 +219,9 @@ MessageBuffer::enqueue(MsgPtr message, Time delta)
push_heap(m_prio_heap.begin(), m_prio_heap.end(),
greater<MessageBufferNode>());
- DPRINTF(RubyQueue, "Enqueue %s with arrival_time %lld cur_time: %lld, "
- "message: %s.\n",
- m_name, arrival_time, g_eventQueue_ptr->getTime(),
- (*(message.get())));
+ DPRINTF(RubyQueue, "Enqueue with arrival_time %lld (cur_time: %lld).\n",
+ arrival_time, g_eventQueue_ptr->getTime());
+ DPRINTF(RubyQueue, "Enqueue Message: %s.\n", (*(message.get())));
// Schedule the wakeup
if (m_consumer_ptr != NULL) {
@@ -253,7 +249,7 @@ MessageBuffer::dequeue_getDelayCycles(MsgPtr& message)
void
MessageBuffer::dequeue(MsgPtr& message)
{
- DPRINTF(RubyQueue, "Dequeue from %s\n", m_name);
+ DPRINTF(RubyQueue, "Dequeueing\n");
message = m_prio_heap.front().m_msgptr;
pop();
@@ -280,7 +276,7 @@ MessageBuffer::dequeue_getDelayCycles()
void
MessageBuffer::pop()
{
- DPRINTF(RubyQueue, "Pop from %s\n", m_name);
+ DPRINTF(RubyQueue, "Popping\n");
assert(isReady());
pop_heap(m_prio_heap.begin(), m_prio_heap.end(),
greater<MessageBufferNode>());
@@ -311,7 +307,7 @@ MessageBuffer::clear()
void
MessageBuffer::recycle()
{
- DPRINTF(RubyQueue, "Recycling %s\n", m_name);
+ DPRINTF(RubyQueue, "Recycling.\n");
assert(isReady());
MessageBufferNode node = m_prio_heap.front();
pop_heap(m_prio_heap.begin(), m_prio_heap.end(),
@@ -327,7 +323,7 @@ MessageBuffer::recycle()
void
MessageBuffer::reanalyzeMessages(const Address& addr)
{
- DPRINTF(RubyQueue, "ReanalyzeMessages %s\n", m_name);
+ DPRINTF(RubyQueue, "ReanalyzeMessages\n");
assert(m_stall_msg_map.count(addr) > 0);
//
@@ -353,7 +349,7 @@ MessageBuffer::reanalyzeMessages(const Address& addr)
void
MessageBuffer::reanalyzeAllMessages()
{
- DPRINTF(RubyQueue, "ReanalyzeAllMessages %s\n", m_name);
+ DPRINTF(RubyQueue, "ReanalyzeAllMessages %s\n");
//
// Put all stalled messages associated with this address back on the
@@ -384,7 +380,7 @@ MessageBuffer::reanalyzeAllMessages()
void
MessageBuffer::stallMessage(const Address& addr)
{
- DPRINTF(RubyQueue, "Stalling %s\n", m_name);
+ DPRINTF(RubyQueue, "Stalling %s\n");
assert(isReady());
assert(addr.getOffset() == 0);
MsgPtr message = m_prio_heap.front().m_msgptr;
@@ -421,14 +417,14 @@ MessageBuffer::setAndReturnDelayCycles(MsgPtr msg_ptr)
void
MessageBuffer::print(ostream& out) const
{
- out << "[MessageBuffer: ";
+ ccprintf(out, "[MessageBuffer: ");
if (m_consumer_ptr != NULL) {
- out << " consumer-yes ";
+ ccprintf(out, " consumer-yes ");
}
vector<MessageBufferNode> copy(m_prio_heap);
sort_heap(copy.begin(), copy.end(), greater<MessageBufferNode>());
- out << copy << "] " << m_name << endl;
+ ccprintf(out, "%s] %s", copy, m_name);
}
void
diff --git a/src/mem/ruby/buffers/MessageBuffer.hh b/src/mem/ruby/buffers/MessageBuffer.hh
index 88df5b788..a59b82077 100644
--- a/src/mem/ruby/buffers/MessageBuffer.hh
+++ b/src/mem/ruby/buffers/MessageBuffer.hh
@@ -53,6 +53,8 @@ class MessageBuffer
public:
MessageBuffer(const std::string &name = "");
+ std::string name() const { return m_name; }
+
static void printConfig(std::ostream& out) {}
void
setRecycleLatency(int recycle_latency)
diff --git a/src/mem/ruby/common/NetDest.hh b/src/mem/ruby/common/NetDest.hh
index dc4a54965..b5c571577 100644
--- a/src/mem/ruby/common/NetDest.hh
+++ b/src/mem/ruby/common/NetDest.hh
@@ -54,9 +54,7 @@ class NetDest
NetDest& operator=(const Set& obj);
~NetDest()
- {
- DPRINTF(RubyMemory, "NetDest Destructor\n");
- }
+ { }
void add(MachineID newElement);
void addNetDest(const NetDest& netDest);
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc
index 5c461c63f..9f197f4cd 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.cc
+++ b/src/mem/ruby/network/simple/PerfectSwitch.cc
@@ -131,8 +131,6 @@ PerfectSwitch::~PerfectSwitch()
void
PerfectSwitch::wakeup()
{
- DPRINTF(RubyNetwork, "m_switch_id: %d\n",m_switch_id);
-
MsgPtr msg_ptr;
// Give the highest numbered link priority most of the time
@@ -255,7 +253,7 @@ PerfectSwitch::wakeup()
int outgoing = output_links[i];
if (!m_out[outgoing][vnet]->areNSlotsAvailable(1))
enough = false;
- DPRINTF(RubyNetwork, "Checking if node is blocked\n"
+ DPRINTF(RubyNetwork, "Checking if node is blocked ..."
"outgoing: %d, vnet: %d, enough: %d\n",
outgoing, vnet, enough);
}
@@ -264,8 +262,8 @@ PerfectSwitch::wakeup()
if (!enough) {
g_eventQueue_ptr->scheduleEvent(this, 1);
DPRINTF(RubyNetwork, "Can't deliver message since a node "
- "is blocked\n"
- "Message: %s\n", (*net_msg_ptr));
+ "is blocked\n");
+ DPRINTF(RubyNetwork, "Message: %s\n", (*net_msg_ptr));
break; // go to next incoming port
}
@@ -302,9 +300,9 @@ PerfectSwitch::wakeup()
output_link_destinations[i];
// Enqeue msg
- DPRINTF(RubyNetwork, "Switch: %d enqueuing net msg from "
+ DPRINTF(RubyNetwork, "%d enqueuing net msg from "
"inport[%d][%d] to outport [%d][%d] time: %lld.\n",
- m_switch_id, incoming, vnet, outgoing, vnet,
+ incoming, vnet, outgoing, vnet,
g_eventQueue_ptr->getTime());
m_out[outgoing][vnet]->enqueue(msg_ptr);
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.hh b/src/mem/ruby/network/simple/PerfectSwitch.hh
index cd0219fd9..41125083f 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.hh
+++ b/src/mem/ruby/network/simple/PerfectSwitch.hh
@@ -38,6 +38,7 @@
#include <iostream>
#include <vector>
+#include <string>
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh"
@@ -59,6 +60,9 @@ class PerfectSwitch : public Consumer
PerfectSwitch(SwitchID sid, SimpleNetwork* network_ptr);
~PerfectSwitch();
+ std::string name()
+ { return csprintf("PerfectSwitch-%i", m_switch_id); }
+
void addInPort(const std::vector<MessageBuffer*>& in);
void addOutPort(const std::vector<MessageBuffer*>& out,
const NetDest& routing_table_entry);
diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc
index 55e5b4e78..28638cca9 100644
--- a/src/mem/ruby/network/simple/Throttle.cc
+++ b/src/mem/ruby/network/simple/Throttle.cc
@@ -250,8 +250,7 @@ Throttle::getUtilization() const
void
Throttle::print(ostream& out) const
{
- out << "[Throttle: " << m_sID << " " << m_node
- << " bw: " << getLinkBandwidth() << "]";
+ ccprintf(out, "[%i bw: %i]", m_node, getLinkBandwidth());
}
int
diff --git a/src/mem/ruby/network/simple/Throttle.hh b/src/mem/ruby/network/simple/Throttle.hh
index c80f24d77..b4e6c867e 100644
--- a/src/mem/ruby/network/simple/Throttle.hh
+++ b/src/mem/ruby/network/simple/Throttle.hh
@@ -40,6 +40,7 @@
#include <iostream>
#include <vector>
+#include <string>
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh"
@@ -57,6 +58,9 @@ class Throttle : public Consumer
Throttle(NodeID node, int link_latency, int link_bandwidth_multiplier);
~Throttle() {}
+ std::string name()
+ { return csprintf("Throttle-%i", m_sID); }
+
void addLinks(const std::vector<MessageBuffer*>& in_vec,
const std::vector<MessageBuffer*>& out_vec);
void wakeup();