From a0aa4823f46b7040f0458d0d84d085b47ece8c8d Mon Sep 17 00:00:00 2001 From: Mahmoud Date: Mon, 30 Sep 2019 18:34:34 -0400 Subject: trace driven static linking and fixing the inst count bug --- src/abstract_hardware_model.h | 3 ++- src/gpgpu-sim/shader.cc | 5 +++-- src/trace-driven/trace_driven.cc | 9 +++++---- src/trace-driven/trace_opcode.h | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index 341e44c..a267d38 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -103,7 +103,8 @@ enum uarch_op_t { BARRIER_OP, MEMORY_BARRIER_OP, CALL_OPS, - RET_OPS + RET_OPS, + EXIT_OPS }; typedef enum uarch_op_t op_type; diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc index cc85f3f..e5a1e7d 100644 --- a/src/gpgpu-sim/shader.cc +++ b/src/gpgpu-sim/shader.cc @@ -1083,6 +1083,7 @@ void scheduler_unit::cycle() SCHED_DPRINTF( "Warp (warp_id %u, dynamic_warp_id %u) has valid instruction (%s)\n", (*iter)->get_warp_id(), (*iter)->get_dynamic_warp_id(), m_shader->m_config->gpgpu_ctx->func_sim->ptx_get_insn_str( pc).c_str() ); + if( pI ) { assert(valid); if( pc != pI->pc ) { @@ -1559,8 +1560,8 @@ void shader_core_ctx::warp_inst_complete(const warp_inst_t &inst) { #if 0 - 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()); + printf("[warp_inst_complete] uid=%u core=%u warp=%u pc=%#x @ time=%llu \n", + inst.get_uid(), m_sid, inst.warp_id(), inst.pc, m_gpu->gpu_tot_sim_cycle + m_gpu->gpu_sim_cycle); #endif if(inst.op_pipe==SP__OP) diff --git a/src/trace-driven/trace_driven.cc b/src/trace-driven/trace_driven.cc index b73f6cd..8ebc5ca 100644 --- a/src/trace-driven/trace_driven.cc +++ b/src/trace-driven/trace_driven.cc @@ -153,6 +153,7 @@ void trace_shd_warp_t::clear() { warp_traces.clear(); } +//functional_done bool trace_shd_warp_t::trace_done() { return trace_pc==(warp_traces.size()); } @@ -537,10 +538,8 @@ void trace_shader_core_ctx::checkExecutionStatusAndUpdate(warp_inst_t &inst, uns if(inst.isatomic()) m_warp[inst.warp_id()].inc_n_atomic(); - if ( m_trace_warp[inst.warp_id()].trace_done() ) { + if ( inst.op == EXIT_OPS ) m_warp[inst.warp_id()].set_completed(t); - m_warp[inst.warp_id()].ibuffer_flush(); - } } @@ -560,7 +559,9 @@ void trace_shader_core_ctx::func_exec_inst( warp_inst_t &inst ) checkExecutionStatusAndUpdate(inst,t,tid); } } - if(m_trace_warp[inst.warp_id()].trace_done() ) + if(m_trace_warp[inst.warp_id()].trace_done() && m_warp[inst.warp_id()].functional_done()) { + m_warp[inst.warp_id()].ibuffer_flush(); m_barriers.warp_exit( inst.warp_id() ); + } } diff --git a/src/trace-driven/trace_opcode.h b/src/trace-driven/trace_opcode.h index e74dec4..2138e1c 100644 --- a/src/trace-driven/trace_opcode.h +++ b/src/trace-driven/trace_opcode.h @@ -186,7 +186,7 @@ static const std::unordered_map OpcodeMap = { {"BSSY", OpcodeChar(OP_BSSY, BRANCH_OP)}, {"BSYNC", OpcodeChar(OP_BSYNC, BRANCH_OP)}, {"CALL", OpcodeChar(OP_CALL, CALL_OPS)}, - {"EXIT", OpcodeChar(OP_EXIT, BRANCH_OP)}, + {"EXIT", OpcodeChar(OP_EXIT, EXIT_OPS)}, {"JMP", OpcodeChar(OP_JMP, BRANCH_OP)}, {"JMX", OpcodeChar(OP_JMX, BRANCH_OP)}, {"KILL", OpcodeChar(OP_KILL, BRANCH_OP)}, -- cgit v1.3