summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/gpu-cache.h
diff options
context:
space:
mode:
authortgrogers <[email protected]>2019-06-19 10:40:40 -0400
committertgrogers <[email protected]>2019-06-19 10:40:40 -0400
commit7e0fd203206a3671cd93b615ef84ec6eec709db1 (patch)
treeede1f545ed628386bbbe689f42d9c5a85e110e21 /src/gpgpu-sim/gpu-cache.h
parent48830687ede62b3acaebeba93633255b4d8ec9c8 (diff)
parenta1e2c4273542ca78098c9f4f25eebc087e0aec37 (diff)
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'src/gpgpu-sim/gpu-cache.h')
-rw-r--r--src/gpgpu-sim/gpu-cache.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/gpgpu-sim/gpu-cache.h b/src/gpgpu-sim/gpu-cache.h
index d11a7fd..be33d96 100644
--- a/src/gpgpu-sim/gpu-cache.h
+++ b/src/gpgpu-sim/gpu-cache.h
@@ -968,6 +968,66 @@ struct cache_sub_stats{
void print_port_stats(FILE *fout, const char *cache_name) const;
};
+
+// Used for collecting AerialVision per-window statistics
+struct cache_sub_stats_pw{
+ unsigned accesses;
+ unsigned write_misses;
+ unsigned write_hits;
+ unsigned write_pending_hits;
+ unsigned write_res_fails;
+
+ unsigned read_misses;
+ unsigned read_hits;
+ unsigned read_pending_hits;
+ unsigned read_res_fails;
+
+ cache_sub_stats_pw(){
+ clear();
+ }
+ void clear(){
+ accesses = 0;
+ write_misses = 0;
+ write_hits = 0;
+ write_pending_hits = 0;
+ write_res_fails = 0;
+ read_misses = 0;
+ read_hits = 0;
+ read_pending_hits = 0;
+ read_res_fails = 0;
+ }
+ cache_sub_stats_pw &operator+=(const cache_sub_stats_pw &css){
+ ///
+ /// Overloading += operator to easily accumulate stats
+ ///
+ accesses += css.accesses;
+ write_misses += css.write_misses;
+ read_misses += css.read_misses;
+ write_pending_hits += css.write_pending_hits;
+ read_pending_hits += css.read_pending_hits;
+ write_res_fails += css.write_res_fails;
+ read_res_fails += css.read_res_fails;
+ return *this;
+ }
+
+ cache_sub_stats_pw operator+(const cache_sub_stats_pw &cs){
+ ///
+ /// Overloading + operator to easily accumulate stats
+ ///
+ cache_sub_stats_pw ret;
+ ret.accesses = accesses + cs.accesses;
+ ret.write_misses = write_misses + cs.write_misses;
+ ret.read_misses = read_misses + cs.read_misses;
+ ret.write_pending_hits = write_pending_hits + cs.write_pending_hits;
+ ret.read_pending_hits = read_pending_hits + cs.read_pending_hits;
+ ret.write_res_fails = write_res_fails + cs.write_res_fails;
+ ret.read_res_fails = read_res_fails + cs.read_res_fails;
+ return ret;
+ }
+
+};
+
+
///
/// Cache_stats
/// Used to record statistics for each cache.
@@ -978,7 +1038,11 @@ class cache_stats {
public:
cache_stats();
void clear();
+ // Clear AerialVision cache stats after each window
+ void clear_pw();
void inc_stats(int access_type, int access_outcome);
+ // Increment AerialVision cache stats
+ void inc_stats_pw(int access_type, int access_outcome);
void inc_fail_stats(int access_type, int fail_outcome);
enum cache_request_status select_stats_status(enum cache_request_status probe, enum cache_request_status access) const;
unsigned long long &operator()(int access_type, int access_outcome, bool fail_outcome);
@@ -991,12 +1055,18 @@ public:
unsigned long long get_stats(enum mem_access_type *access_type, unsigned num_access_type, enum cache_request_status *access_status, unsigned num_access_status) const;
void get_sub_stats(struct cache_sub_stats &css) const;
+ // Get per-window cache stats for AerialVision
+ void get_sub_stats_pw(struct cache_sub_stats_pw &css) const;
+
void sample_cache_port_utility(bool data_port_busy, bool fill_port_busy);
private:
bool check_valid(int type, int status) const;
bool check_fail_valid(int type, int fail) const;
+
std::vector< std::vector<unsigned long long> > m_stats;
+ // AerialVision cache stats (per-window)
+ std::vector< std::vector<unsigned long long> > m_stats_pw;
std::vector< std::vector<unsigned long long> > m_fail_stats;
unsigned long long m_cache_port_available_cycles;
@@ -1082,6 +1152,14 @@ public:
void get_sub_stats(struct cache_sub_stats &css) const {
m_stats.get_sub_stats(css);
}
+ // Clear per-window stats for AerialVision support
+ void clear_pw(){
+ m_stats.clear_pw();
+ }
+ // Per-window sub stats for AerialVision support
+ void get_sub_stats_pw(struct cache_sub_stats_pw &css) const {
+ m_stats.get_sub_stats_pw(css);
+ }
// accessors for cache bandwidth availability
bool data_port_free() const { return m_bandwidth_management.data_port_free(); }