Throttle.hh (6154:6bb54dcb940e) Throttle.hh (6285:ce086eca1ede)
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

41
42#ifndef THROTTLE_H
43#define THROTTLE_H
44
45#include "mem/ruby/common/Global.hh"
46#include "mem/gems_common/Vector.hh"
47#include "mem/ruby/common/Consumer.hh"
48#include "mem/ruby/system/NodeID.hh"
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

41
42#ifndef THROTTLE_H
43#define THROTTLE_H
44
45#include "mem/ruby/common/Global.hh"
46#include "mem/gems_common/Vector.hh"
47#include "mem/ruby/common/Consumer.hh"
48#include "mem/ruby/system/NodeID.hh"
49#include "mem/ruby/config/RubyConfig.hh"
49#include "mem/ruby/system/System.hh"
50#include "mem/ruby/network/Network.hh"
50
51class MessageBuffer;
52
53class Throttle : public Consumer {
54public:
55 // Constructors
56 Throttle(int sID, NodeID node, int link_latency, int link_bandwidth_multiplier);
57 Throttle(NodeID node, int link_latency, int link_bandwidth_multiplier);

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

63 void addLinks(const Vector<MessageBuffer*>& in_vec, const Vector<MessageBuffer*>& out_vec);
64 void wakeup();
65 bool broadcastBandwidthAvailable(int rand) const;
66
67 void printStats(ostream& out) const;
68 void clearStats();
69 void printConfig(ostream& out) const;
70 double getUtilization() const; // The average utilization (a percent) since last clearStats()
51
52class MessageBuffer;
53
54class Throttle : public Consumer {
55public:
56 // Constructors
57 Throttle(int sID, NodeID node, int link_latency, int link_bandwidth_multiplier);
58 Throttle(NodeID node, int link_latency, int link_bandwidth_multiplier);

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

64 void addLinks(const Vector<MessageBuffer*>& in_vec, const Vector<MessageBuffer*>& out_vec);
65 void wakeup();
66 bool broadcastBandwidthAvailable(int rand) const;
67
68 void printStats(ostream& out) const;
69 void clearStats();
70 void printConfig(ostream& out) const;
71 double getUtilization() const; // The average utilization (a percent) since last clearStats()
71 int getLinkBandwidth() const { return g_endpoint_bandwidth * m_link_bandwidth_multiplier; }
72 int getLinkBandwidth() const { return RubySystem::getNetwork()->getEndpointBandwidth() * m_link_bandwidth_multiplier; }
72 int getLatency() const { return m_link_latency; }
73
74 const Vector<Vector<int> >& getCounters() const { return m_message_counters; }
75
76 void clear();
77
78 void print(ostream& out) const;
79

--- 45 unchanged lines hidden ---
73 int getLatency() const { return m_link_latency; }
74
75 const Vector<Vector<int> >& getCounters() const { return m_message_counters; }
76
77 void clear();
78
79 void print(ostream& out) const;
80

--- 45 unchanged lines hidden ---