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; --- 17 unchanged lines hidden (view full) --- 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <cassert> 30 31#include "base/cast.hh" 32#include "base/cprintf.hh" 33#include "debug/RubyNetwork.hh" |
34#include "mem/ruby/network/simple/Throttle.hh" 35#include "mem/ruby/network/MessageBuffer.hh" 36#include "mem/ruby/network/Network.hh" 37#include "mem/ruby/slicc_interface/Message.hh" 38#include "mem/ruby/system/System.hh" 39 40using namespace std; 41 42const int MESSAGE_SIZE_MULTIPLIER = 1000; 43//const int BROADCAST_SCALING = 4; // Have a 16p system act like a 64p systems 44const int BROADCAST_SCALING = 1; 45const int PRIORITY_SWITCH_LIMIT = 128; 46 47static int network_message_to_size(Message* net_msg_ptr); 48 49Throttle::Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency, 50 int link_bandwidth_multiplier, int endpoint_bandwidth, |
51 ClockedObject *em) 52 : Consumer(em), m_ruby_system(rs) |
53{ |
54 init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth); 55 m_sID = sID; 56} 57 58Throttle::Throttle(RubySystem *rs, NodeID node, Cycles link_latency, 59 int link_bandwidth_multiplier, int endpoint_bandwidth, 60 ClockedObject *em) 61 : Consumer(em), m_ruby_system(rs) 62{ 63 init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth); 64 m_sID = 0; 65} 66 67void 68Throttle::init(NodeID node, Cycles link_latency, 69 int link_bandwidth_multiplier, int endpoint_bandwidth) 70{ 71 m_node = node; |
72 m_vnets = 0; 73 74 assert(link_bandwidth_multiplier > 0); 75 m_link_bandwidth_multiplier = link_bandwidth_multiplier; 76 77 m_link_latency = link_latency; 78 m_endpoint_bandwidth = endpoint_bandwidth; 79 --- 13 unchanged lines hidden (view full) --- 93 94 m_vnets++; 95 m_units_remaining.push_back(0); 96 m_in.push_back(in_ptr); 97 m_out.push_back(out_ptr); 98 99 // Set consumer and description 100 in_ptr->setConsumer(this); |
101 string desc = "[Queue to Throttle " + to_string(m_sID) + " " + |
102 to_string(m_node) + "]"; 103 } 104} 105 106void 107Throttle::operateVnet(int vnet, int &bw_remaining, bool &schedule_wakeup, 108 MessageBuffer *in, MessageBuffer *out) 109{ --- 163 unchanged lines hidden --- |