diff options
| -rw-r--r-- | Makefile | 13 | ||||
| -rw-r--r-- | src/abstract_hardware_model.h | 3 | ||||
| -rw-r--r-- | src/gpgpu-sim/shader.cc | 5 | ||||
| -rw-r--r-- | src/trace-driven/trace_driven.cc | 9 | ||||
| -rw-r--r-- | src/trace-driven/trace_opcode.h | 2 |
5 files changed, 21 insertions, 11 deletions
@@ -172,15 +172,16 @@ $(SIM_LIB_DIR)/libcudart.so: makedirs $(LIBS) cudalib $(SIM_LIB_DIR)/gpgpusim.out: makedirs $(LIBS) cudalib $(SIM_LIB_DIR)/libcudart.so - ar rvs $(SIM_LIB_DIR)/libcudart_static.a\ + ar rvs $(SIM_LIB_DIR)/libgpgpusim_static.a\ $(SIM_OBJ_FILES_DIR)/libcuda/*.o \ $(SIM_OBJ_FILES_DIR)/cuda-sim/*.o \ $(SIM_OBJ_FILES_DIR)/cuda-sim/decuda_pred_table/*.o \ $(SIM_OBJ_FILES_DIR)/gpgpu-sim/*.o \ $(SIM_OBJ_FILES_DIR)/$(INTERSIM)/*.o \ + $(SIM_OBJ_FILES_DIR)/trace-driven/*.o \ $(SIM_OBJ_FILES_DIR)/*.o \ $(MCPAT) - g++ -std=c++0x -L$(SIM_LIB_DIR) -I$(CUDA_INSTALL_PATH)/include -lcudart -lm -lz -lGL -pthread -o $(SIM_LIB_DIR)/gpgpusim.out src/trace-driven/gpgpusim_trace_driven_main.cc + g++ -std=c++0x -o $(SIM_LIB_DIR)/gpgpusim.out src/trace-driven/gpgpusim_trace_driven_main.cc -L$(SIM_LIB_DIR) -I$(CUDA_INSTALL_PATH)/include -lgpgpusim_static -lm -lz -lGL -pthread $(SIM_LIB_DIR)/libcudart.dylib: makedirs $(LIBS) cudalib g++ -dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,1.1,-current_version,1.1\ @@ -220,8 +221,14 @@ cuda-sim: makedirs $(MAKE) -C ./src/cuda-sim/ depend $(MAKE) -C ./src/cuda-sim/ +TFLAGS = -std=c++0x -I$(CUDA_INSTALL_PATH)/include +ifneq ($(DEBUG),1) + TFLAGS += -O3 +endif +TFLAGS += -g3 -fPIC + trace-driven: makedirs - g++ -fPIC -std=c++0x -I$(CUDA_INSTALL_PATH)/include -c src/trace-driven/trace_driven.cc -o $(SIM_OBJ_FILES_DIR)/trace-driven/trace_driven.o + g++ $(TFLAGS) -c src/trace-driven/trace_driven.cc -o $(SIM_OBJ_FILES_DIR)/trace-driven/trace_driven.o gpgpu-sim_uarch: makedirs cuda-sim $(MAKE) -C ./src/gpgpu-sim/ depend 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<std::string,OpcodeChar> 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)}, |
