PerfectSwitch.cc (10370:4466307b8a2a) | PerfectSwitch.cc (10895:287285860dd6) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 21 unchanged lines hidden (view full) --- 30 31#include "base/cast.hh" 32#include "base/random.hh" 33#include "debug/RubyNetwork.hh" 34#include "mem/ruby/network/MessageBuffer.hh" 35#include "mem/ruby/network/simple/PerfectSwitch.hh" 36#include "mem/ruby/network/simple/SimpleNetwork.hh" 37#include "mem/ruby/network/simple/Switch.hh" | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 21 unchanged lines hidden (view full) --- 30 31#include "base/cast.hh" 32#include "base/random.hh" 33#include "debug/RubyNetwork.hh" 34#include "mem/ruby/network/MessageBuffer.hh" 35#include "mem/ruby/network/simple/PerfectSwitch.hh" 36#include "mem/ruby/network/simple/SimpleNetwork.hh" 37#include "mem/ruby/network/simple/Switch.hh" |
38#include "mem/ruby/slicc_interface/NetworkMessage.hh" | 38#include "mem/ruby/slicc_interface/Message.hh" |
39 40using namespace std; 41 42const int PRIORITY_SWITCH_LIMIT = 128; 43 44// Operator for helper class 45bool 46operator<(const LinkOrder& l1, const LinkOrder& l2) --- 60 unchanged lines hidden (view full) --- 107PerfectSwitch::~PerfectSwitch() 108{ 109} 110 111void 112PerfectSwitch::operateVnet(int vnet) 113{ 114 MsgPtr msg_ptr; | 39 40using namespace std; 41 42const int PRIORITY_SWITCH_LIMIT = 128; 43 44// Operator for helper class 45bool 46operator<(const LinkOrder& l1, const LinkOrder& l2) --- 60 unchanged lines hidden (view full) --- 107PerfectSwitch::~PerfectSwitch() 108{ 109} 110 111void 112PerfectSwitch::operateVnet(int vnet) 113{ 114 MsgPtr msg_ptr; |
115 NetworkMessage* net_msg_ptr = NULL; | 115 Message *net_msg_ptr = NULL; |
116 117 // This is for round-robin scheduling 118 int incoming = m_round_robin_start; 119 m_round_robin_start++; 120 if (m_round_robin_start >= m_in.size()) { 121 m_round_robin_start = 0; 122 } 123 --- 20 unchanged lines hidden (view full) --- 144 continue; 145 } 146 147 while (buffer->isReady()) { 148 DPRINTF(RubyNetwork, "incoming: %d\n", incoming); 149 150 // Peek at message 151 msg_ptr = buffer->peekMsgPtr(); | 116 117 // This is for round-robin scheduling 118 int incoming = m_round_robin_start; 119 m_round_robin_start++; 120 if (m_round_robin_start >= m_in.size()) { 121 m_round_robin_start = 0; 122 } 123 --- 20 unchanged lines hidden (view full) --- 144 continue; 145 } 146 147 while (buffer->isReady()) { 148 DPRINTF(RubyNetwork, "incoming: %d\n", incoming); 149 150 // Peek at message 151 msg_ptr = buffer->peekMsgPtr(); |
152 net_msg_ptr = safe_cast<NetworkMessage*>(msg_ptr.get()); | 152 net_msg_ptr = msg_ptr.get(); |
153 DPRINTF(RubyNetwork, "Message: %s\n", (*net_msg_ptr)); 154 155 output_links.clear(); 156 output_link_destinations.clear(); | 153 DPRINTF(RubyNetwork, "Message: %s\n", (*net_msg_ptr)); 154 155 output_links.clear(); 156 output_link_destinations.clear(); |
157 NetDest msg_dsts = net_msg_ptr->getInternalDestination(); | 157 NetDest msg_dsts = net_msg_ptr->getDestination(); |
158 159 // Unfortunately, the token-protocol sends some 160 // zero-destination messages, so this assert isn't valid 161 // assert(msg_dsts.count() > 0); 162 163 assert(m_link_order.size() == m_routing_table.size()); 164 assert(m_link_order.size() == m_out.size()); 165 --- 93 unchanged lines hidden (view full) --- 259 260 if (i > 0) { 261 // create a private copy of the unmodified message 262 msg_ptr = unmodified_msg_ptr->clone(); 263 } 264 265 // Change the internal destination set of the message so it 266 // knows which destinations this link is responsible for. | 158 159 // Unfortunately, the token-protocol sends some 160 // zero-destination messages, so this assert isn't valid 161 // assert(msg_dsts.count() > 0); 162 163 assert(m_link_order.size() == m_routing_table.size()); 164 assert(m_link_order.size() == m_out.size()); 165 --- 93 unchanged lines hidden (view full) --- 259 260 if (i > 0) { 261 // create a private copy of the unmodified message 262 msg_ptr = unmodified_msg_ptr->clone(); 263 } 264 265 // Change the internal destination set of the message so it 266 // knows which destinations this link is responsible for. |
267 net_msg_ptr = safe_cast<NetworkMessage*>(msg_ptr.get()); 268 net_msg_ptr->getInternalDestination() = | 267 net_msg_ptr = msg_ptr.get(); 268 net_msg_ptr->getDestination() = |
269 output_link_destinations[i]; 270 271 // Enqeue msg 272 DPRINTF(RubyNetwork, "Enqueuing net msg from " 273 "inport[%d][%d] to outport [%d][%d].\n", 274 incoming, vnet, outgoing, vnet); 275 276 m_out[outgoing][vnet]->enqueue(msg_ptr); --- 52 unchanged lines hidden --- | 269 output_link_destinations[i]; 270 271 // Enqeue msg 272 DPRINTF(RubyNetwork, "Enqueuing net msg from " 273 "inport[%d][%d] to outport [%d][%d].\n", 274 incoming, vnet, outgoing, vnet); 275 276 m_out[outgoing][vnet]->enqueue(msg_ptr); --- 52 unchanged lines hidden --- |