From 9333cfbf261666ac2a3d40b712b6cbb3346d8c00 Mon Sep 17 00:00:00 2001 From: Ahmed El-Shafiey Date: Thu, 20 Dec 2012 20:40:54 -0800 Subject: 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] --- src/gpgpu-sim/gpu-cache.h | 2 ++ src/gpgpu-sim/power_stat.cc | 2 +- src/gpgpu-sim/shader.cc | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gpgpu-sim') 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 &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 -- cgit v1.3