Throttle.cc (7780:42da07116e12) | Throttle.cc (7832:de7601e6e19d) |
---|---|
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; --- 12 unchanged lines hidden (view full) --- 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 | 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; --- 12 unchanged lines hidden (view full) --- 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 |
29#include <cassert> 30 |
|
29#include "base/cprintf.hh" 30#include "mem/protocol/Protocol.hh" 31#include "mem/ruby/buffers/MessageBuffer.hh" 32#include "mem/ruby/network/Network.hh" 33#include "mem/ruby/network/simple/Throttle.hh" 34#include "mem/ruby/slicc_interface/NetworkMessage.hh" 35#include "mem/ruby/system/System.hh" 36 37using namespace std; 38 39const int HIGH_RANGE = 256; 40const int ADJUST_INTERVAL = 50000; 41const int MESSAGE_SIZE_MULTIPLIER = 1000; 42//const int BROADCAST_SCALING = 4; // Have a 16p system act like a 64p systems 43const int BROADCAST_SCALING = 1; 44const int PRIORITY_SWITCH_LIMIT = 128; 45 46static int network_message_to_size(NetworkMessage* net_msg_ptr); 47 | 31#include "base/cprintf.hh" 32#include "mem/protocol/Protocol.hh" 33#include "mem/ruby/buffers/MessageBuffer.hh" 34#include "mem/ruby/network/Network.hh" 35#include "mem/ruby/network/simple/Throttle.hh" 36#include "mem/ruby/slicc_interface/NetworkMessage.hh" 37#include "mem/ruby/system/System.hh" 38 39using namespace std; 40 41const int HIGH_RANGE = 256; 42const int ADJUST_INTERVAL = 50000; 43const int MESSAGE_SIZE_MULTIPLIER = 1000; 44//const int BROADCAST_SCALING = 4; // Have a 16p system act like a 64p systems 45const int BROADCAST_SCALING = 1; 46const int PRIORITY_SWITCH_LIMIT = 128; 47 48static int network_message_to_size(NetworkMessage* net_msg_ptr); 49 |
48extern ostream *debug_cout_ptr; 49 | |
50Throttle::Throttle(int sID, NodeID node, int link_latency, 51 int link_bandwidth_multiplier) 52{ 53 init(node, link_latency, link_bandwidth_multiplier); 54 m_sID = sID; 55} 56 57Throttle::Throttle(NodeID node, int link_latency, --- 4 unchanged lines hidden (view full) --- 62} 63 64void 65Throttle::init(NodeID node, int link_latency, int link_bandwidth_multiplier) 66{ 67 m_node = node; 68 m_vnets = 0; 69 | 50Throttle::Throttle(int sID, NodeID node, int link_latency, 51 int link_bandwidth_multiplier) 52{ 53 init(node, link_latency, link_bandwidth_multiplier); 54 m_sID = sID; 55} 56 57Throttle::Throttle(NodeID node, int link_latency, --- 4 unchanged lines hidden (view full) --- 62} 63 64void 65Throttle::init(NodeID node, int link_latency, int link_bandwidth_multiplier) 66{ 67 m_node = node; 68 m_vnets = 0; 69 |
70 ASSERT(link_bandwidth_multiplier > 0); | 70 assert(link_bandwidth_multiplier > 0); |
71 m_link_bandwidth_multiplier = link_bandwidth_multiplier; 72 m_link_latency = link_latency; 73 74 m_wakeups_wo_switch = 0; 75 clearStats(); 76} 77 78void --- 193 unchanged lines hidden --- | 71 m_link_bandwidth_multiplier = link_bandwidth_multiplier; 72 m_link_latency = link_latency; 73 74 m_wakeups_wo_switch = 0; 75 clearStats(); 76} 77 78void --- 193 unchanged lines hidden --- |