From a4e786e7ba32deb2877722650a907ccdb1bef096 Mon Sep 17 00:00:00 2001 From: Ahmed El-Shafiey Date: Fri, 30 Nov 2012 23:07:40 -0800 Subject: fixing a segfault problem for Quadro config with interconnect stats [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14737] --- src/gpgpu-sim/gpu-sim.cc | 2 +- src/gpgpu-sim/gpu-sim.h | 1 + src/gpgpu-sim/shader.cc | 13 +++++++++---- src/mcpat/gpgpu_sim_wrapper.cc | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc index b2b00a4..9d3145b 100644 --- a/src/gpgpu-sim/gpu-sim.cc +++ b/src/gpgpu-sim/gpu-sim.cc @@ -759,7 +759,7 @@ void gpgpu_sim::gpu_print_stat() m_memory_partition_unit[i]->set_icnt_power_stats(temp); total_mem_to_simt += temp; } - for(unsigned i=0; iset_icnt_stats(temp); total_simt_to_mem += temp; diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h index 7866688..98f719f 100644 --- a/src/gpgpu-sim/gpu-sim.h +++ b/src/gpgpu-sim/gpu-sim.h @@ -302,6 +302,7 @@ public: } unsigned num_shader() const { return m_shader_config.num_shader(); } + unsigned num_cluster() const { return m_shader_config.n_simt_clusters; } unsigned get_max_concurrent_kernel() const { return max_concurrent_kernel; } private: diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc index 4095cbc..ad097e8 100644 --- a/src/gpgpu-sim/shader.cc +++ b/src/gpgpu-sim/shader.cc @@ -971,10 +971,15 @@ void ldst_unit::set_icnt_power_stats(unsigned &simt_to_mem) const{ unsigned tex=0; unsigned l1c=0; - m_L1D->set_icnt_power_stats(l1d); - m_L1T->set_icnt_power_stats(tex); - m_L1C->set_icnt_power_stats(l1c); - + if( m_L1D ) { + m_L1D->set_icnt_power_stats(l1d); + } + if( m_L1T ){ + m_L1T->set_icnt_power_stats(tex); + } + if( m_L1C ){ + m_L1C->set_icnt_power_stats(l1c); + } simt_to_mem = n_simt_to_mem+l1d+tex+l1c; // All components that push packets into the interconnect } diff --git a/src/mcpat/gpgpu_sim_wrapper.cc b/src/mcpat/gpgpu_sim_wrapper.cc index 0ed7f57..1b06e26 100644 --- a/src/mcpat/gpgpu_sim_wrapper.cc +++ b/src/mcpat/gpgpu_sim_wrapper.cc @@ -241,7 +241,7 @@ void gpgpu_sim_wrapper::set_inst_power(bool clk_gated_lanes, double tot_cycles, p->sys.core[0].gpgpu_clock_gated_lanes = clk_gated_lanes; p->sys.core[0].total_cycles = tot_cycles; p->sys.core[0].busy_cycles = busy_cycles; - p->sys.core[0].total_instructions = tot_inst * p->sys.scaling_coefficients[TOT_INST];; + p->sys.core[0].total_instructions = tot_inst * p->sys.scaling_coefficients[TOT_INST]; p->sys.core[0].int_instructions = int_inst * p->sys.scaling_coefficients[FP_INT]; p->sys.core[0].fp_instructions = fp_inst * p->sys.scaling_coefficients[FP_INT]; p->sys.core[0].load_instructions = load_inst; -- cgit v1.3