summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmed El-Shafiey <[email protected]>2012-12-20 20:40:54 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:49:23 -0700
commit9333cfbf261666ac2a3d40b712b6cbb3346d8c00 (patch)
treeb6b14f3636fb4f01171965a6fbff2cf215ff78db
parentfecd769d1e7813b6cf962218208810049e2ad777 (diff)
fixing more bugs in interconnect stats, simt_to_mem related stats were wrongly allocated and not initialized
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14856]
-rw-r--r--src/gpgpu-sim/gpu-cache.h2
-rw-r--r--src/gpgpu-sim/power_stat.cc2
-rw-r--r--src/gpgpu-sim/shader.cc6
-rw-r--r--src/gpuwattch/gpgpu_sim_wrapper.cc20
4 files changed, 17 insertions, 13 deletions
diff --git a/src/gpgpu-sim/gpu-cache.h b/src/gpgpu-sim/gpu-cache.h
index 783280c..ac5fee8 100644
--- a/src/gpgpu-sim/gpu-cache.h
+++ b/src/gpgpu-sim/gpu-cache.h
@@ -373,6 +373,7 @@ public:
m_write_access=0;
m_read_miss=0;
m_write_miss=0;
+ n_simt_to_mem=0;
}
virtual enum cache_request_status access( new_addr_type addr, mem_fetch *mf, unsigned time, std::list<cache_event> &events ) = 0;
@@ -587,6 +588,7 @@ public:
m_cache = new data_block[ config.get_num_lines() ];
m_request_queue_status = request_status;
m_rob_status = rob_status;
+ n_simt_to_mem=0;
}
/// Access function for tex_cache
diff --git a/src/gpgpu-sim/power_stat.cc b/src/gpgpu-sim/power_stat.cc
index e1f4f8a..0332e73 100644
--- a/src/gpgpu-sim/power_stat.cc
+++ b/src/gpgpu-sim/power_stat.cc
@@ -96,7 +96,7 @@ void power_mem_stat_t::init(){
// Interconnect stats
n_mem_to_simt[i] = (unsigned *)calloc(m_config->m_n_mem,sizeof(unsigned)); // Counted at memory partition
- n_simt_to_mem[i] = (unsigned *)calloc(m_core_config->num_shader(),sizeof(unsigned)); // Counted at SM
+ n_simt_to_mem[i] = (unsigned *)calloc(m_core_config->n_simt_clusters,sizeof(unsigned)); // Counted at SM
}
}
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 64088af..0aa8532 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -1339,6 +1339,7 @@ ldst_unit::ldst_unit( mem_fetch_interface *icnt,
m_mem_rc = NO_RC_FAIL;
m_num_writeback_clients=5; // = shared memory, global/local (uncached), L1D, L1T, L1C
m_writeback_arb = 0;
+ n_simt_to_mem = 0;
m_next_global=NULL;
m_last_inst_gpu_sim_cycle=0;
m_last_inst_gpu_tot_sim_cycle=0;
@@ -2333,8 +2334,9 @@ void shader_core_ctx::get_cache_stats(unsigned &read_accesses, unsigned &write_a
void shader_core_ctx::set_icnt_power_stats(unsigned &n_simt_to_mem) const{
unsigned l1i=0;
-
- m_L1I->set_icnt_power_stats(l1i);
+ if( m_L1I ){
+ m_L1I->set_icnt_power_stats(l1i);
+ }
m_ldst_unit->set_icnt_power_stats(n_simt_to_mem);
n_simt_to_mem+=l1i; // l1i + l1d + l1c + l1t + any non-cached access
diff --git a/src/gpuwattch/gpgpu_sim_wrapper.cc b/src/gpuwattch/gpgpu_sim_wrapper.cc
index adbd03c..2792da0 100644
--- a/src/gpuwattch/gpgpu_sim_wrapper.cc
+++ b/src/gpuwattch/gpgpu_sim_wrapper.cc
@@ -107,16 +107,16 @@ gpgpu_sim_wrapper::gpgpu_sim_wrapper( bool power_simulation_enabled, char* xmlfi
num_pwr_cmps=NUM_COMPONENTS_MODELLED;
num_per_counts=NUM_PERFORMANCE_COUNTERS;
pavg=0;
- perf_count=(double *)calloc(100,sizeof(double));
- initpower_coeff=(double *)calloc(100,sizeof(double));
- effpower_coeff=(double *)calloc(100,sizeof(double));
- pwr_cmp=(double *)calloc(100,sizeof(double));
- pwr_cmp_avg=(double *)calloc(100,sizeof(double));
- pwr_cmp_min=(double *)calloc(100,sizeof(double));
- pwr_cmp_max=(double *)calloc(100,sizeof(double));
- perf_count_avg=(double *)calloc(100,sizeof(double));
- perf_count_min=(double *)calloc(100,sizeof(double));
- perf_count_max=(double *)calloc(100,sizeof(double));
+ perf_count=(double *)calloc(num_per_counts,sizeof(double));
+ initpower_coeff=(double *)calloc(num_per_counts,sizeof(double));
+ effpower_coeff=(double *)calloc(num_per_counts,sizeof(double));
+ perf_count_avg=(double *)calloc(num_per_counts,sizeof(double));
+ perf_count_min=(double *)calloc(num_per_counts,sizeof(double));
+ perf_count_max=(double *)calloc(num_per_counts,sizeof(double));
+ pwr_cmp=(double *)calloc(num_pwr_cmps,sizeof(double));
+ pwr_cmp_avg=(double *)calloc(num_pwr_cmps,sizeof(double));
+ pwr_cmp_min=(double *)calloc(num_pwr_cmps,sizeof(double));
+ pwr_cmp_max=(double *)calloc(num_pwr_cmps,sizeof(double));
const_dynamic_power=0;
gpu_min_power=0;
gpu_tot_min_power=0;