diff options
| author | Wilson Fung <[email protected]> | 2012-02-20 23:56:01 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:19:03 -0700 |
| commit | 7092b55e927a46128d279d544ff2a32887e81126 (patch) | |
| tree | 0aa79634aa6bb75ffdd27ac4d7bd2c9d2edf9fa0 /src | |
| parent | 85ff8940cb900dff92f459d9d24a0597997e41b7 (diff) | |
Fix for bug 129. Created a directed test with a pre-known instruction count, and observed the over-count for vector memory instruction. The fix eliminates the over-count.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 11481]
Diffstat (limited to 'src')
| -rw-r--r-- | src/abstract_hardware_model.cc | 2 | ||||
| -rw-r--r-- | src/abstract_hardware_model.h | 2 | ||||
| -rw-r--r-- | src/gpgpu-sim/shader.cc | 8 |
3 files changed, 4 insertions, 8 deletions
diff --git a/src/abstract_hardware_model.cc b/src/abstract_hardware_model.cc index 841be93..6010bf6 100644 --- a/src/abstract_hardware_model.cc +++ b/src/abstract_hardware_model.cc @@ -489,7 +489,7 @@ void warp_inst_t::memory_coalescing_arch_13_reduce_and_send( bool is_write, mem_ m_accessq.push_back( mem_access_t(access_type,addr,size,is_write,info.active,info.bytes) ); } -void warp_inst_t::completed( unsigned long long cycle ) +void warp_inst_t::completed( unsigned long long cycle ) const { unsigned long long latency = cycle - issue_cycle; assert(latency <= cycle); // underflow detection diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index 3bc7538..1be293d 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -694,7 +694,7 @@ public: m_cache_hit=false; m_empty=false; } - void completed( unsigned long long cycle ); // stat collection: called when the instruction is completed + void completed( unsigned long long cycle ) const; // stat collection: called when the instruction is completed void set_addr( unsigned n, new_addr_type addr ) { if( !m_per_scalar_thread_valid ) { diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc index 1cc596b..742d3c9 100644 --- a/src/gpgpu-sim/shader.cc +++ b/src/gpgpu-sim/shader.cc @@ -716,6 +716,7 @@ void shader_core_ctx::warp_inst_complete(const warp_inst_t &inst) m_stats->m_num_sim_insn[m_sid] += inst.active_count(); m_stats->m_num_sim_winsn[m_sid]++; m_gpu->gpu_sim_insn += inst.active_count(); + inst.completed(gpu_tot_sim_cycle + gpu_sim_cycle); } void shader_core_ctx::writeback() @@ -726,7 +727,6 @@ void shader_core_ctx::writeback() m_scoreboard->releaseRegisters( pipe_reg ); m_warp[warp_id].dec_inst_in_pipeline(); warp_inst_complete(*pipe_reg); - pipe_reg->completed(gpu_tot_sim_cycle + gpu_sim_cycle); m_gpu->gpu_sim_insn_last_update_sid = m_sid; m_gpu->gpu_sim_insn_last_update = gpu_sim_cycle; m_last_inst_gpu_sim_cycle = gpu_sim_cycle; @@ -966,18 +966,16 @@ void ldst_unit::writeback() if( !still_pending ) { m_pending_writes[m_next_wb.warp_id()].erase(m_next_wb.out[r]); m_scoreboard->releaseRegister( m_next_wb.warp_id(), m_next_wb.out[r] ); - m_core->warp_inst_complete(m_next_wb); insn_completed = true; } } else { // shared m_scoreboard->releaseRegister( m_next_wb.warp_id(), m_next_wb.out[r] ); - m_core->warp_inst_complete(m_next_wb); insn_completed = true; } } } if( insn_completed ) { - m_next_wb.completed( gpu_tot_sim_cycle + gpu_sim_cycle ); + m_core->warp_inst_complete(m_next_wb); } m_next_wb.clear(); m_last_inst_gpu_sim_cycle = gpu_sim_cycle; @@ -1126,7 +1124,6 @@ void ldst_unit::cycle() } if( !pending_requests ) { m_core->warp_inst_complete(*m_dispatch_reg); - m_dispatch_reg->completed(gpu_tot_sim_cycle + gpu_sim_cycle); m_scoreboard->releaseRegisters(m_dispatch_reg); } m_core->dec_inst_in_pipeline(warp_id); @@ -1136,7 +1133,6 @@ void ldst_unit::cycle() // stores exit pipeline here m_core->dec_inst_in_pipeline(warp_id); m_core->warp_inst_complete(*m_dispatch_reg); - m_dispatch_reg->completed(gpu_tot_sim_cycle + gpu_sim_cycle); m_dispatch_reg->clear(); } } |
