Throttle.hh (10370:4466307b8a2a) | Throttle.hh (10918:dd3ab1f109ad) |
---|---|
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; --- 38 unchanged lines hidden (view full) --- 47#include "mem/ruby/network/Network.hh" 48#include "mem/ruby/system/System.hh" 49 50class MessageBuffer; 51 52class Throttle : public Consumer 53{ 54 public: | 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; --- 38 unchanged lines hidden (view full) --- 47#include "mem/ruby/network/Network.hh" 48#include "mem/ruby/system/System.hh" 49 50class MessageBuffer; 51 52class Throttle : public Consumer 53{ 54 public: |
55 Throttle(int sID, NodeID node, Cycles link_latency, | 55 Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency, |
56 int link_bandwidth_multiplier, int endpoint_bandwidth, 57 ClockedObject *em); | 56 int link_bandwidth_multiplier, int endpoint_bandwidth, 57 ClockedObject *em); |
58 Throttle(NodeID node, Cycles link_latency, int link_bandwidth_multiplier, 59 int endpoint_bandwidth, ClockedObject *em); | 58 Throttle(RubySystem *rs, NodeID node, Cycles link_latency, 59 int link_bandwidth_multiplier, int endpoint_bandwidth, 60 ClockedObject *em); |
60 ~Throttle() {} 61 62 std::string name() 63 { return csprintf("Throttle-%i", m_sID); } 64 65 void addLinks(const std::vector<MessageBuffer*>& in_vec, 66 const std::vector<MessageBuffer*>& out_vec); 67 void wakeup(); --- 30 unchanged lines hidden (view full) --- 98 std::vector<int> m_units_remaining; 99 100 int m_sID; 101 NodeID m_node; 102 int m_link_bandwidth_multiplier; 103 Cycles m_link_latency; 104 int m_wakeups_wo_switch; 105 int m_endpoint_bandwidth; | 61 ~Throttle() {} 62 63 std::string name() 64 { return csprintf("Throttle-%i", m_sID); } 65 66 void addLinks(const std::vector<MessageBuffer*>& in_vec, 67 const std::vector<MessageBuffer*>& out_vec); 68 void wakeup(); --- 30 unchanged lines hidden (view full) --- 99 std::vector<int> m_units_remaining; 100 101 int m_sID; 102 NodeID m_node; 103 int m_link_bandwidth_multiplier; 104 Cycles m_link_latency; 105 int m_wakeups_wo_switch; 106 int m_endpoint_bandwidth; |
107 RubySystem *m_ruby_system; |
|
106 107 // Statistical variables 108 Stats::Scalar m_link_utilization; 109 Stats::Vector m_msg_counts[MessageSizeType_NUM]; 110 Stats::Formula m_msg_bytes[MessageSizeType_NUM]; 111 112 double m_link_utilization_proxy; 113}; 114 115inline std::ostream& 116operator<<(std::ostream& out, const Throttle& obj) 117{ 118 obj.print(out); 119 out << std::flush; 120 return out; 121} 122 123#endif // __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__ | 108 109 // Statistical variables 110 Stats::Scalar m_link_utilization; 111 Stats::Vector m_msg_counts[MessageSizeType_NUM]; 112 Stats::Formula m_msg_bytes[MessageSizeType_NUM]; 113 114 double m_link_utilization_proxy; 115}; 116 117inline std::ostream& 118operator<<(std::ostream& out, const Throttle& obj) 119{ 120 obj.print(out); 121 out << std::flush; 122 return out; 123} 124 125#endif // __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__ |