summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/simple/PerfectSwitch.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2010-12-01 11:30:04 -0800
committerNilay Vaish <nilay@cs.wisc.edu>2010-12-01 11:30:04 -0800
commit658849d101c98b6d8c7a06f41ffbe39675848eac (patch)
tree7a47868ca2c4c61887730db571d24feadc8c04de /src/mem/ruby/network/simple/PerfectSwitch.cc
parent0f039fe447c9b1a6e885d8e5e794c25c10da39b9 (diff)
downloadgem5-658849d101c98b6d8c7a06f41ffbe39675848eac.tar.xz
ruby: Converted old ruby debug calls to M5 debug calls
This patch developed by Nilay Vaish converts all the old GEMS-style ruby debug calls to the appropriate M5 debug calls.
Diffstat (limited to 'src/mem/ruby/network/simple/PerfectSwitch.cc')
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.cc31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc
index 5a1ee32ec..7229c724f 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.cc
+++ b/src/mem/ruby/network/simple/PerfectSwitch.cc
@@ -123,7 +123,7 @@ PerfectSwitch::~PerfectSwitch()
void
PerfectSwitch::wakeup()
{
- DEBUG_EXPR(NETWORK_COMP, MedPrio, m_switch_id);
+ DPRINTF(RubyNetwork, "m_switch_id: %d\n",m_switch_id);
MsgPtr msg_ptr;
@@ -168,12 +168,12 @@ PerfectSwitch::wakeup()
// Is there a message waiting?
while (m_in[incoming][vnet]->isReady()) {
- DEBUG_EXPR(NETWORK_COMP, MedPrio, incoming);
+ DPRINTF(RubyNetwork, "incoming: %d\n", incoming);
// Peek at message
msg_ptr = m_in[incoming][vnet]->peekMsgPtr();
net_msg_ptr = safe_cast<NetworkMessage*>(msg_ptr.get());
- DEBUG_EXPR(NETWORK_COMP, MedPrio, *net_msg_ptr);
+ DPRINTF(RubyNetwork, "Message: %s\n", (*net_msg_ptr));
output_links.clear();
output_link_destinations.clear();
@@ -216,7 +216,7 @@ PerfectSwitch::wakeup()
// pick the next link to look at
int link = m_link_order[i].m_link;
NetDest dst = m_routing_table[link];
- DEBUG_EXPR(NETWORK_COMP, MedPrio, dst);
+ DPRINTF(RubyNetwork, "dst: %s\n", dst);
if (!msg_dsts.intersectionIsNotEmpty(dst))
continue;
@@ -246,19 +246,17 @@ PerfectSwitch::wakeup()
int outgoing = output_links[i];
if (!m_out[outgoing][vnet]->areNSlotsAvailable(1))
enough = false;
- DEBUG_MSG(NETWORK_COMP, HighPrio,
- "checking if node is blocked");
- DEBUG_EXPR(NETWORK_COMP, HighPrio, outgoing);
- DEBUG_EXPR(NETWORK_COMP, HighPrio, vnet);
- DEBUG_EXPR(NETWORK_COMP, HighPrio, enough);
+ DPRINTF(RubyNetwork, "Checking if node is blocked\n"
+ "outgoing: %d, vnet: %d, enough: %d\n",
+ outgoing, vnet, enough);
}
// There were not enough resources
if (!enough) {
g_eventQueue_ptr->scheduleEvent(this, 1);
- DEBUG_MSG(NETWORK_COMP, HighPrio,
- "Can't deliver message since a node is blocked");
- DEBUG_EXPR(NETWORK_COMP, HighPrio, *net_msg_ptr);
+ DPRINTF(RubyNetwork, "Can't deliver message since a node "
+ "is blocked\n"
+ "Message: %s\n", (*net_msg_ptr));
break; // go to next incoming port
}
@@ -295,13 +293,10 @@ PerfectSwitch::wakeup()
output_link_destinations[i];
// Enqeue msg
- DEBUG_NEWLINE(NETWORK_COMP,HighPrio);
- DEBUG_MSG(NETWORK_COMP, HighPrio,
- csprintf("switch: %d enqueuing net msg from "
- "inport[%d][%d] to outport [%d][%d] time: %d.",
+ DPRINTF(RubyNetwork, "Switch: %d enqueuing net msg from "
+ "inport[%d][%d] to outport [%d][%d] time: %lld.\n",
m_switch_id, incoming, vnet, outgoing, vnet,
- g_eventQueue_ptr->getTime()));
- DEBUG_NEWLINE(NETWORK_COMP,HighPrio);
+ g_eventQueue_ptr->getTime());
m_out[outgoing][vnet]->enqueue(msg_ptr);
}