Deleted Added
sdiff udiff text old ( 11049:dfb0aa3f0649 ) new ( 11092:a51ef09e3a78 )
full compact
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/Switch.hh"
35#include "mem/ruby/network/simple/Throttle.hh"
36#include "mem/ruby/network/MessageBuffer.hh"
37#include "mem/ruby/network/Network.hh"
38#include "mem/ruby/slicc_interface/Message.hh"
39#include "mem/ruby/system/System.hh"
40
41using namespace std;
42
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(Message* net_msg_ptr);
49
50Throttle::Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency,
51 int link_bandwidth_multiplier, int endpoint_bandwidth,
52 Switch *em)
53 : Consumer(em), m_switch_id(sID), m_switch(em), m_node(node),
54 m_ruby_system(rs)
55{
56 m_vnets = 0;
57
58 assert(link_bandwidth_multiplier > 0);
59 m_link_bandwidth_multiplier = link_bandwidth_multiplier;
60
61 m_link_latency = link_latency;
62 m_endpoint_bandwidth = endpoint_bandwidth;
63

--- 13 unchanged lines hidden (view full) ---

77
78 m_vnets++;
79 m_units_remaining.push_back(0);
80 m_in.push_back(in_ptr);
81 m_out.push_back(out_ptr);
82
83 // Set consumer and description
84 in_ptr->setConsumer(this);
85 string desc = "[Queue to Throttle " + to_string(m_switch_id) + " " +
86 to_string(m_node) + "]";
87 }
88}
89
90void
91Throttle::operateVnet(int vnet, int &bw_remaining, bool &schedule_wakeup,
92 MessageBuffer *in, MessageBuffer *out)
93{

--- 163 unchanged lines hidden ---