diff options
| author | Mahmoud <[email protected]> | 2020-05-23 20:06:25 -0400 |
|---|---|---|
| committer | Mahmoud <[email protected]> | 2020-05-23 20:06:25 -0400 |
| commit | d610fd81420979e956bf37100f7e1c7f1d153831 (patch) | |
| tree | 392a841f21fec5136339ff36ad9b5c7b1b4cb480 /src/gpgpu-sim/traffic_breakdown.h | |
| parent | 6cedd3ef4973f3785757413db89a7c5d0ee2b58b (diff) | |
| parent | e9e9fcf5957530ecb927aecb5ea238e4b78a4f45 (diff) | |
Merge branch 'dev' of https://github.com/purdue-aalp/gpgpu-sim_distribution into dev-traces
Diffstat (limited to 'src/gpgpu-sim/traffic_breakdown.h')
| -rw-r--r-- | src/gpgpu-sim/traffic_breakdown.h | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/gpgpu-sim/traffic_breakdown.h b/src/gpgpu-sim/traffic_breakdown.h index c9b8df5..a898519 100644 --- a/src/gpgpu-sim/traffic_breakdown.h +++ b/src/gpgpu-sim/traffic_breakdown.h @@ -1,37 +1,35 @@ -#pragma once +#pragma once #include <stdio.h> #include <map> -#include <string> +#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) - { } +class traffic_breakdown { + public: + traffic_breakdown(const std::string& network_name) + : m_network_name(network_name) {} - // print the stats - void print(FILE* fout); + // 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); + // record the amount and type of traffic introduced by this mem_fetch object + void record_traffic(class mem_fetch* mf, unsigned int size); -protected: + protected: + std::string m_network_name; - 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 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); - /// 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; - 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; -}; + traffic_stat_t m_stats; +}; |
