summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/simple/Switch.hh
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:35 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:35 -0500
commit90bfbd9793e64b29d09f4ca4ee610ee08f82ea75 (patch)
treee14b49f9632b25cde8a32b5e5787a36a376e6dff /src/mem/ruby/network/simple/Switch.hh
parente9ae8b7d29e83fa2cad55006d2c6dc58115965cc (diff)
downloadgem5-90bfbd9793e64b29d09f4ca4ee610ee08f82ea75.tar.xz
ruby: network: convert to gem5 style stats
Diffstat (limited to 'src/mem/ruby/network/simple/Switch.hh')
-rw-r--r--src/mem/ruby/network/simple/Switch.hh16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mem/ruby/network/simple/Switch.hh b/src/mem/ruby/network/simple/Switch.hh
index f60a31ab3..47f4c0858 100644
--- a/src/mem/ruby/network/simple/Switch.hh
+++ b/src/mem/ruby/network/simple/Switch.hh
@@ -67,12 +67,13 @@ class Switch : public BasicRouter
int bw_multiplier);
const Throttle* getThrottle(LinkID link_number) const;
const std::vector<Throttle*>* getThrottles() const;
- void clearRoutingTables();
- void clearBuffers();
- void reconfigureOutPort(const NetDest& routing_table_entry);
- void printStats(std::ostream& out) const;
- void clearStats();
+ void resetStats();
+ void collateStats();
+ void regStats();
+ const Stats::Formula & getMsgCount(unsigned int type) const
+ { return m_msg_counts[type]; }
+
void print(std::ostream& out) const;
void init_net_ptr(SimpleNetwork* net_ptr) { m_network_ptr = net_ptr; }
@@ -88,6 +89,11 @@ class Switch : public BasicRouter
SimpleNetwork* m_network_ptr;
std::vector<Throttle*> m_throttles;
std::vector<MessageBuffer*> m_buffers_to_free;
+
+ // Statistical variables
+ Stats::Formula m_avg_utilization;
+ std::vector<Stats::Formula> m_msg_counts;
+ std::vector<Stats::Formula> m_msg_bytes;
};
inline std::ostream&