Throttle.hh (11049:dfb0aa3f0649) Throttle.hh (11092:a51ef09e3a78)
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;

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

42#include <string>
43#include <vector>
44
45#include "mem/ruby/common/Consumer.hh"
46#include "mem/ruby/network/Network.hh"
47#include "mem/ruby/system/System.hh"
48
49class MessageBuffer;
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;

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

42#include <string>
43#include <vector>
44
45#include "mem/ruby/common/Consumer.hh"
46#include "mem/ruby/network/Network.hh"
47#include "mem/ruby/system/System.hh"
48
49class MessageBuffer;
50class Switch;
50
51class Throttle : public Consumer
52{
53 public:
54 Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency,
55 int link_bandwidth_multiplier, int endpoint_bandwidth,
51
52class Throttle : public Consumer
53{
54 public:
55 Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency,
56 int link_bandwidth_multiplier, int endpoint_bandwidth,
56 ClockedObject *em);
57 Throttle(RubySystem *rs, NodeID node, Cycles link_latency,
58 int link_bandwidth_multiplier, int endpoint_bandwidth,
59 ClockedObject *em);
57 Switch *em);
60 ~Throttle() {}
61
62 std::string name()
58 ~Throttle() {}
59
60 std::string name()
63 { return csprintf("Throttle-%i", m_sID); }
61 { return csprintf("Throttle-%i", m_switch_id); }
64
65 void addLinks(const std::vector<MessageBuffer*>& in_vec,
66 const std::vector<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; }

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

92 Throttle(const Throttle& obj);
93 Throttle& operator=(const Throttle& obj);
94
95 std::vector<MessageBuffer*> m_in;
96 std::vector<MessageBuffer*> m_out;
97 unsigned int m_vnets;
98 std::vector<int> m_units_remaining;
99
62
63 void addLinks(const std::vector<MessageBuffer*>& in_vec,
64 const std::vector<MessageBuffer*>& out_vec);
65 void wakeup();
66
67 // The average utilization (a fraction) since last clearStats()
68 const Stats::Scalar & getUtilization() const
69 { return m_link_utilization; }

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

90 Throttle(const Throttle& obj);
91 Throttle& operator=(const Throttle& obj);
92
93 std::vector<MessageBuffer*> m_in;
94 std::vector<MessageBuffer*> m_out;
95 unsigned int m_vnets;
96 std::vector<int> m_units_remaining;
97
100 int m_sID;
98 const int m_switch_id;
99 Switch *m_switch;
101 NodeID m_node;
100 NodeID m_node;
101
102 int m_link_bandwidth_multiplier;
103 Cycles m_link_latency;
104 int m_wakeups_wo_switch;
105 int m_endpoint_bandwidth;
106 RubySystem *m_ruby_system;
107
108 // Statistical variables
109 Stats::Scalar m_link_utilization;

--- 15 unchanged lines hidden ---
102 int m_link_bandwidth_multiplier;
103 Cycles m_link_latency;
104 int m_wakeups_wo_switch;
105 int m_endpoint_bandwidth;
106 RubySystem *m_ruby_system;
107
108 // Statistical variables
109 Stats::Scalar m_link_utilization;

--- 15 unchanged lines hidden ---