summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gpgpu-sim/gpu-sim.cc16
-rw-r--r--src/gpgpu-sim/l2cache.cc8
-rw-r--r--src/gpgpu-sim/l2cache.h5
-rw-r--r--src/gpgpu-sim/power_stat.cc3
-rw-r--r--src/gpgpu-sim/shader.cc8
-rw-r--r--src/gpgpu-sim/shader.h7
6 files changed, 18 insertions, 29 deletions
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index 07b06a8..0abe14a 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -824,19 +824,18 @@ void gpgpu_sim::gpu_print_stat()
// Interconnect power stat print
unsigned total_mem_to_simt=0;
unsigned total_simt_to_mem=0;
- for (unsigned i=0;i<m_memory_config->m_n_mem;i++){
- unsigned temp=0;
- m_memory_partition_unit[i]->set_icnt_power_stats(temp);
- total_mem_to_simt += temp;
- }
+
for(unsigned i=0; i<m_config.num_cluster(); i++){
unsigned temp=0;
- m_cluster[i]->set_icnt_stats(temp);
+ unsigned temp2 = 0;
+ m_cluster[i]->set_icnt_stats(temp, temp2);
total_simt_to_mem += temp;
+ total_mem_to_simt += temp2;
}
printf("\nicnt_total_pkts_mem_to_simt=%u\n", total_mem_to_simt);
printf("icnt_total_pkts_simt_to_mem=%u\n\n", total_simt_to_mem);
+
time_vector_print();
fflush(stdout);
@@ -1053,8 +1052,6 @@ void gpgpu_sim::cycle()
m_memory_partition_unit[i]->cache_cycle(gpu_sim_cycle+gpu_tot_sim_cycle);
m_memory_partition_unit[i]->set_L2cache_power_stats(m_power_stats->pwr_mem_stat->n_l2_read_access[0][i], m_power_stats->pwr_mem_stat->n_l2_read_miss[0][i],
m_power_stats->pwr_mem_stat->n_l2_write_access[0][i], m_power_stats->pwr_mem_stat->n_l2_write_miss[0][i]);
-
- m_memory_partition_unit[i]->set_icnt_power_stats(m_power_stats->pwr_mem_stat->n_mem_to_simt[0][i]);
}
}
@@ -1070,7 +1067,8 @@ void gpgpu_sim::cycle()
*active_sms+=m_cluster[i]->get_n_active_sms();
// Interconnect power stats: SIMT->MEM
- m_cluster[i]->set_icnt_stats(m_power_stats->pwr_mem_stat->n_simt_to_mem[0][i]);
+ m_cluster[i]->set_icnt_stats(m_power_stats->pwr_mem_stat->n_simt_to_mem[0][i],
+ m_power_stats->pwr_mem_stat->n_mem_to_simt[0][i]);
}
}
float temp=0;
diff --git a/src/gpgpu-sim/l2cache.cc b/src/gpgpu-sim/l2cache.cc
index 21f837d..0a3d56f 100644
--- a/src/gpgpu-sim/l2cache.cc
+++ b/src/gpgpu-sim/l2cache.cc
@@ -76,7 +76,6 @@ memory_partition_unit::memory_partition_unit( unsigned partition_id,
if(!m_config->m_L2_config.disabled())
m_L2cache = new l2_cache(L2c_name,m_config->m_L2_config,-1,-1,m_L2interface,m_mf_allocator,IN_PARTITION_L2_MISS_QUEUE);
- n_mem_to_simt=0;
unsigned int icnt_L2;
unsigned int L2_dram;
unsigned int dram_L2;
@@ -109,7 +108,6 @@ void memory_partition_unit::cache_cycle( unsigned cycle )
mf->set_reply();
mf->set_status(IN_PARTITION_L2_TO_ICNT_QUEUE,gpu_sim_cycle+gpu_tot_sim_cycle);
m_L2_icnt_queue->push(mf);
- n_mem_to_simt+=mf->get_num_flits(false); // Interconnect power stats (# of flits sent to the SMs)
}else{
m_request_tracker.erase(mf);
delete mf;
@@ -128,7 +126,6 @@ void memory_partition_unit::cache_cycle( unsigned cycle )
mf->set_status(IN_PARTITION_L2_TO_ICNT_QUEUE,gpu_sim_cycle+gpu_tot_sim_cycle);
m_L2_icnt_queue->push(mf);
m_dram_L2_queue->pop();
- n_mem_to_simt+=mf->get_num_flits(false); // Interconnect power stats (# of flits sent to the SMs)
}
}
@@ -160,7 +157,6 @@ void memory_partition_unit::cache_cycle( unsigned cycle )
mf->set_reply();
mf->set_status(IN_PARTITION_L2_TO_ICNT_QUEUE,gpu_sim_cycle+gpu_tot_sim_cycle);
m_L2_icnt_queue->push(mf);
- n_mem_to_simt+=mf->get_num_flits(false); // Interconnect power stats (# of flits sent to the SMs)
}
m_icnt_L2_queue->pop();
} else {
@@ -413,7 +409,3 @@ void memory_partition_unit::set_L2cache_power_stats(unsigned &n_read_access,
unsigned &n_write_miss) const{
m_L2cache->get_data_stats(n_read_access,n_read_miss,n_write_access,n_write_miss);
}
-
-void memory_partition_unit::set_icnt_power_stats(unsigned &mem_to_simt) const{
- mem_to_simt = n_mem_to_simt;
-}
diff --git a/src/gpgpu-sim/l2cache.h b/src/gpgpu-sim/l2cache.h
index 9317c18..31b9c4a 100644
--- a/src/gpgpu-sim/l2cache.h
+++ b/src/gpgpu-sim/l2cache.h
@@ -93,8 +93,6 @@ public:
unsigned &n_write_access,
unsigned &n_write_miss) const;
- void set_icnt_power_stats(unsigned &n_mem_to_simt) const;
-
private:
// data
unsigned m_id;
@@ -134,9 +132,6 @@ private:
std::set<mem_fetch*> m_request_tracker;
friend class L2interface;
-
- // interconnect power stats
- unsigned n_mem_to_simt;
};
class L2interface : public mem_fetch_interface {
diff --git a/src/gpgpu-sim/power_stat.cc b/src/gpgpu-sim/power_stat.cc
index 12c9574..eb4cb31 100644
--- a/src/gpgpu-sim/power_stat.cc
+++ b/src/gpgpu-sim/power_stat.cc
@@ -95,7 +95,8 @@ void power_mem_stat_t::init(){
n_req[i] = (unsigned *)calloc(m_config->m_n_mem,sizeof(unsigned));
// Interconnect stats
- n_mem_to_simt[i] = (unsigned *)calloc(m_config->m_n_mem,sizeof(unsigned)); // Counted at memory partition
+ //n_mem_to_simt[i] = (unsigned *)calloc(m_config->m_n_mem,sizeof(unsigned)); // Counted at memory partition
+ n_mem_to_simt[i] = (unsigned *)calloc(m_core_config->n_simt_clusters*m_core_config->n_simt_cores_per_cluster,sizeof(unsigned)); // Counted at SM
n_simt_to_mem[i] = (unsigned *)calloc(m_core_config->n_simt_clusters*m_core_config->n_simt_cores_per_cluster,sizeof(unsigned)); // Counted at SM
}
}
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index d38f300..ba44c01 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -2621,8 +2621,9 @@ void shader_core_ctx::get_cache_stats(unsigned &read_accesses, unsigned &write_a
m_ldst_unit->get_cache_stats(read_accesses, write_accesses, read_misses, write_misses, cache_type);
}
-void shader_core_ctx::set_icnt_power_stats(unsigned &n_simt_to_mem) const{
+void shader_core_ctx::set_icnt_power_stats(unsigned &n_simt_to_mem, unsigned &n_mem_to_simt) const{
n_simt_to_mem += m_stats->n_simt_to_mem[m_sid];
+ n_mem_to_simt += m_stats->n_mem_to_simt[m_sid];
}
bool shd_warp_t::functional_done() const
@@ -3109,6 +3110,7 @@ void simt_core_cluster::icnt_cycle()
mf->set_status(IN_CLUSTER_TO_SHADER_QUEUE,gpu_sim_cycle+gpu_tot_sim_cycle);
//m_memory_stats->memlatstat_read_done(mf,m_shader_config->max_warps_per_shader);
m_response_fifo.push_back(mf);
+ m_stats->n_mem_to_simt[m_config->sid_to_cid(mf->get_sid())] += mf->get_num_flits(false);
}
}
@@ -3143,9 +3145,9 @@ void simt_core_cluster::get_cache_stats(unsigned &read_accesses, unsigned &write
}
}
-void simt_core_cluster::set_icnt_stats(unsigned &n_simt_to_mem) const {
+void simt_core_cluster::set_icnt_stats(unsigned &n_simt_to_mem, unsigned &n_mem_to_simt) const {
for ( unsigned i = 0; i < m_config->n_simt_cores_per_cluster; ++i ) {
- m_core[i]->set_icnt_power_stats(n_simt_to_mem);
+ m_core[i]->set_icnt_power_stats(n_simt_to_mem, n_mem_to_simt);
}
}
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index c3420e6..ba63634 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -1376,7 +1376,7 @@ struct shader_core_stats_pod {
unsigned *l1d_write_miss; // L1 Data cache write miss
unsigned *n_simt_to_mem; // Interconnect power stats
-
+ unsigned *n_mem_to_simt;
};
class shader_core_stats : public shader_core_stats_pod {
@@ -1439,6 +1439,7 @@ public:
l1d_write_miss = (unsigned *)calloc(config->num_shader(), sizeof(unsigned));
n_simt_to_mem = (unsigned *)calloc(config->num_shader(), sizeof(unsigned));
+ n_mem_to_simt = (unsigned *)calloc(config->num_shader(), sizeof(unsigned));
gpgpu_n_shmem_bank_access = (unsigned *)calloc(config->num_shader(), sizeof(unsigned));
@@ -1585,7 +1586,7 @@ public:
void print_cache_stats( FILE *fp, unsigned& dl1_accesses, unsigned& dl1_misses );
void get_cache_stats(unsigned &read_accesses, unsigned &write_accesses, unsigned &read_misses, unsigned &write_misses, unsigned cache_type);
- void set_icnt_power_stats(unsigned &n_simt_to_mem) const;
+ void set_icnt_power_stats(unsigned &n_simt_to_mem, unsigned &n_mem_to_simt) const;
// debug:
void display_simt_state(FILE *fout, int mask ) const;
@@ -1829,7 +1830,7 @@ public:
void print_cache_stats( FILE *fp, unsigned& dl1_accesses, unsigned& dl1_misses ) const;
void get_cache_stats(unsigned &read_accesses, unsigned &write_accesses, unsigned &read_misses, unsigned &write_misses, unsigned cache_type) const;
- void set_icnt_stats(unsigned &n_simt_to_mem) const;
+ void set_icnt_stats(unsigned &n_simt_to_mem, unsigned &n_mem_to_simt) const;
private:
unsigned m_cluster_id;