Throttle.hh (9866:94dac7d7bb88) Throttle.hh (10311:ad9c042dce54)
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;

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

57 ClockedObject *em);
58 Throttle(NodeID node, Cycles link_latency, int link_bandwidth_multiplier,
59 int endpoint_bandwidth, ClockedObject *em);
60 ~Throttle() {}
61
62 std::string name()
63 { return csprintf("Throttle-%i", m_sID); }
64
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;

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

57 ClockedObject *em);
58 Throttle(NodeID node, Cycles link_latency, int link_bandwidth_multiplier,
59 int endpoint_bandwidth, 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);
65 void addLinks(const std::map<int, MessageBuffer*>& in_vec,
66 const std::map<int, MessageBuffer*>& out_vec);
67 void wakeup();
68
69 // The average utilization (a fraction) since last clearStats()
70 const Stats::Scalar & getUtilization() const
71 { return m_link_utilization; }
72 const Stats::Vector & getMsgCount(unsigned int type) const
73 { return m_msg_counts[type]; }
74

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

80 void clearStats();
81 void collateStats();
82 void regStats(std::string name);
83 void print(std::ostream& out) const;
84
85 private:
86 void init(NodeID node, Cycles link_latency, int link_bandwidth_multiplier,
87 int endpoint_bandwidth);
67 void wakeup();
68
69 // The average utilization (a fraction) since last clearStats()
70 const Stats::Scalar & getUtilization() const
71 { return m_link_utilization; }
72 const Stats::Vector & getMsgCount(unsigned int type) const
73 { return m_msg_counts[type]; }
74

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

80 void clearStats();
81 void collateStats();
82 void regStats(std::string name);
83 void print(std::ostream& out) const;
84
85 private:
86 void init(NodeID node, Cycles link_latency, int link_bandwidth_multiplier,
87 int endpoint_bandwidth);
88 void addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr);
88 void operateVnet(int vnet, int &bw_remainin, bool &schedule_wakeup,
89 MessageBuffer *in, MessageBuffer *out);
89
90 // Private copy constructor and assignment operator
91 Throttle(const Throttle& obj);
92 Throttle& operator=(const Throttle& obj);
93
90
91 // Private copy constructor and assignment operator
92 Throttle(const Throttle& obj);
93 Throttle& operator=(const Throttle& obj);
94
94 std::vector<MessageBuffer*> m_in;
95 std::vector<MessageBuffer*> m_out;
96 unsigned int m_vnets;
97 std::vector<int> m_units_remaining;
95 std::map<int, MessageBuffer*> m_in;
96 std::map<int, MessageBuffer*> m_out;
97 std::map<int, int> m_units_remaining;
98
98 int m_sID;
99 NodeID m_node;
100 int m_link_bandwidth_multiplier;
101 Cycles m_link_latency;
102 int m_wakeups_wo_switch;
103 int m_endpoint_bandwidth;
104
105 // Statistical variables

--- 16 unchanged lines hidden ---
99 int m_sID;
100 NodeID m_node;
101 int m_link_bandwidth_multiplier;
102 Cycles m_link_latency;
103 int m_wakeups_wo_switch;
104 int m_endpoint_bandwidth;
105
106 // Statistical variables

--- 16 unchanged lines hidden ---