diff options
Diffstat (limited to 'src/mem/ruby/network/simple')
-rw-r--r-- | src/mem/ruby/network/simple/PerfectSwitch.cc | 31 | ||||
-rw-r--r-- | src/mem/ruby/network/simple/Throttle.cc | 19 | ||||
-rw-r--r-- | src/mem/ruby/network/simple/Topology.cc | 12 |
3 files changed, 25 insertions, 37 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); } diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc index a77d40dee..096a8f466 100644 --- a/src/mem/ruby/network/simple/Throttle.cc +++ b/src/mem/ruby/network/simple/Throttle.cc @@ -161,12 +161,10 @@ Throttle::wakeup() m_units_remaining[vnet] += network_message_to_size(net_msg_ptr); - DEBUG_NEWLINE(NETWORK_COMP,HighPrio); - DEBUG_MSG(NETWORK_COMP, HighPrio, - csprintf("throttle: %d my bw %d bw spent enqueueing " - "net msg %d time: %d.", + DPRINTF(RubyNetwork, "throttle: %d my bw %d bw spent " + "enqueueing net msg %d time: %lld.\n", m_node, getLinkBandwidth(), m_units_remaining[vnet], - g_eventQueue_ptr->getTime())); + g_eventQueue_ptr->getTime()); // Move the message m_out[vnet]->enqueue(m_in[vnet]->peekMsgPtr(), m_link_latency); @@ -175,8 +173,7 @@ Throttle::wakeup() // Count the message m_message_counters[net_msg_ptr->getMessageSize()][vnet]++; - DEBUG_MSG(NETWORK_COMP,LowPrio,*m_out[vnet]); - DEBUG_NEWLINE(NETWORK_COMP,HighPrio); + DPRINTF(RubyNetwork, "%s\n", *m_out[vnet]); } // Calculate the amount of bandwidth we spent on this message @@ -188,7 +185,7 @@ Throttle::wakeup() if (bw_remaining > 0 && (m_in[vnet]->isReady() || m_units_remaining[vnet] > 0) && !m_out[vnet]->areNSlotsAvailable(1)) { - DEBUG_MSG(NETWORK_COMP,LowPrio,vnet); + DPRINTF(RubyNetwork, "vnet: %d", vnet); // schedule me to wakeup again because I'm waiting for my // output queue to become available schedule_wakeup = true; @@ -209,11 +206,9 @@ Throttle::wakeup() // We have extra bandwidth and our output buffer was // available, so we must not have anything else to do until // another message arrives. - DEBUG_MSG(NETWORK_COMP, LowPrio, *this); - DEBUG_MSG(NETWORK_COMP, LowPrio, "not scheduled again"); + DPRINTF(RubyNetwork, "%s not scheduled again\n", *this); } else { - DEBUG_MSG(NETWORK_COMP, LowPrio, *this); - DEBUG_MSG(NETWORK_COMP, LowPrio, "scheduled again"); + DPRINTF(RubyNetwork, "%s scheduled again\n", *this); // We are out of bandwidth for this cycle, so wakeup next // cycle and continue diff --git a/src/mem/ruby/network/simple/Topology.cc b/src/mem/ruby/network/simple/Topology.cc index bd167bd40..5e6bf9939 100644 --- a/src/mem/ruby/network/simple/Topology.cc +++ b/src/mem/ruby/network/simple/Topology.cc @@ -405,13 +405,11 @@ shortest_path_to_node(SwitchID src, SwitchID next, const Matrix& weights, } } - DEBUG_MSG(NETWORK_COMP, MedPrio, "returning shortest path"); - DEBUG_EXPR(NETWORK_COMP, MedPrio, (src-(2*max_machines))); - DEBUG_EXPR(NETWORK_COMP, MedPrio, (next-(2*max_machines))); - DEBUG_EXPR(NETWORK_COMP, MedPrio, src); - DEBUG_EXPR(NETWORK_COMP, MedPrio, next); - DEBUG_EXPR(NETWORK_COMP, MedPrio, result); - DEBUG_NEWLINE(NETWORK_COMP, MedPrio); + DPRINTF(RubyNetwork, "Returning shortest path\n" + "(src-(2*max_machines)): %d, (next-(2*max_machines)): %d, " + "src: %d, next: %d, result: %s\n", + (src-(2*max_machines)), (next-(2*max_machines)), + src, next, result); return result; } |