summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-08-30 03:08:52 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:48:54 -0700
commit66a788b7463bb92595977c7540afa8a2adba2726 (patch)
treece1bcd41bcfcae274f9ff28fb30fc95b03829521
parentfc37c72f0681d142371ff4f5fff5cd972faf51a9 (diff)
Fixed incorrect counting of predicated instruction. (Bug #15 external)
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13918]
-rw-r--r--CHANGES3
-rw-r--r--src/abstract_hardware_model.h7
-rw-r--r--src/gpgpu-sim/shader.cc4
3 files changed, 10 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 4653061..1a05fbc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -23,6 +23,9 @@ Version 3.1.1+edits (development branch) versus 3.1.1
and store instructions.
- Fixed a bug that was causing inconsistency in local memory address
calculations
+ - Fixed incorrect counting of predicated instructions. Now instructions
+ are counted into gpu_sim_insn regardless of predication outcome. (Bug
+ #15 external)
Version 3.1.1 versus 3.1.0
- Add checks to top level makefile to ensure setup_environment is run and checks to
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index fda4763..766dff1 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -689,7 +689,8 @@ public:
}
void issue( const active_mask_t &mask, unsigned warp_id, unsigned long long cycle )
{
- m_warp_active_mask=mask;
+ m_warp_active_mask = mask;
+ m_warp_issued_mask = mask;
m_uid = ++sm_next_uid;
m_warp_id = warp_id;
issue_cycle = cycle;
@@ -763,6 +764,7 @@ public:
}
bool active( unsigned thread ) const { return m_warp_active_mask.test(thread); }
unsigned active_count() const { return m_warp_active_mask.count(); }
+ unsigned issued_count() const { assert(m_empty == false); return m_warp_issued_mask.count(); } // for instruction counting
bool empty() const { return m_empty; }
unsigned warp_id() const
{
@@ -810,7 +812,8 @@ protected:
bool m_is_printf;
unsigned m_warp_id;
const core_config *m_config;
- active_mask_t m_warp_active_mask;
+ active_mask_t m_warp_active_mask; // dynamic active mask for timing model (after predication)
+ active_mask_t m_warp_issued_mask; // active mask at issue (prior to predication test) -- for instruction counting
struct per_thread_info {
per_thread_info() {
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index ddb544a..b3e5fc5 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -872,9 +872,9 @@ void shader_core_ctx::warp_inst_complete(const warp_inst_t &inst)
printf("[warp_inst_complete] uid=%u core=%u warp=%u pc=%#x @ time=%llu issued@%llu\n",
inst.get_uid(), m_sid, inst.warp_id(), inst.pc, gpu_tot_sim_cycle + gpu_sim_cycle, inst.get_issue_cycle());
#endif
- m_stats->m_num_sim_insn[m_sid] += inst.active_count();
+ m_stats->m_num_sim_insn[m_sid] += inst.issued_count();
m_stats->m_num_sim_winsn[m_sid]++;
- m_gpu->gpu_sim_insn += inst.active_count();
+ m_gpu->gpu_sim_insn += inst.issued_count();
inst.completed(gpu_tot_sim_cycle + gpu_sim_cycle);
}