summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/traffic_breakdown.h
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2013-06-23 02:59:55 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:48 -0700
commitd0d12843ce57c1b0c1e77bae2a43bf222af19375 (patch)
tree07d17add206d8b8d6e83b89954afd8dcd98ac967 /src/gpgpu-sim/traffic_breakdown.h
parent33c2bb5ba2f0b45474fe2a72d87886692d6bf4ca (diff)
Interconnection traffic breakdown stats (integration from TM branch).
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16495]
Diffstat (limited to 'src/gpgpu-sim/traffic_breakdown.h')
-rw-r--r--src/gpgpu-sim/traffic_breakdown.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/gpgpu-sim/traffic_breakdown.h b/src/gpgpu-sim/traffic_breakdown.h
new file mode 100644
index 0000000..c9b8df5
--- /dev/null
+++ b/src/gpgpu-sim/traffic_breakdown.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <stdio.h>
+#include <map>
+#include <string>
+
+// Breakdown traffic through the network according to category
+class traffic_breakdown
+{
+public:
+ traffic_breakdown(const std::string &network_name)
+ : m_network_name(network_name)
+ { }
+
+ // print the stats
+ void print(FILE* fout);
+
+ // record the amount and type of traffic introduced by this mem_fetch object
+ void record_traffic(class mem_fetch * mf, unsigned int size);
+
+protected:
+
+ std::string m_network_name;
+
+ /// helper functions to identify the type of traffic sent
+ std::string classify_memfetch(class mem_fetch * mf);
+
+ /// helper functions to identify the size of traffic sent
+ unsigned int packet_size(class mem_fetch * mf);
+
+ typedef std::string mf_packet_type; // use string so that it remains extensible
+ typedef unsigned int mf_packet_size;
+ typedef std::map < mf_packet_size, unsigned int > traffic_class_t;
+ typedef std::map < mf_packet_type, traffic_class_t > traffic_stat_t;
+
+ traffic_stat_t m_stats;
+};