From 0cb76063ce079a0606598e145da351f134235ab5 Mon Sep 17 00:00:00 2001 From: "Andrew M. B. Boktor" Date: Wed, 18 Apr 2012 16:33:33 -0800 Subject: This changelist implements the following: 1. Adds support for using cuobjdump for both ptx and ptxplus execution. This has been tested with CUDA 4.0 . Ptxplus is no longer supported through decuda/decuda_to_ptxplus 2. Adds support for converting the SASS output by cuobjdump to ptxplus. This has been tested with CUDA 4.0 . The old path that extracts ptx from cubin files is still preserved 3. Adds a bank group model. (WARNING: memory config has changed, please adapt yours). To disable the bank groups model, set nbkgrp to 1 and tCCDL and tRTPL to 0 Diff the configuration files to learn about how to use those new options. Merging //depot/gpgpu_sim_research/fermi-test/distribution/... to //depot/gpgpu_sim_research/fermi/distribution/... [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 12023] --- src/cuda-sim/instructions.cc | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'src/cuda-sim/instructions.cc') diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc index 550a076..4537bd0 100644 --- a/src/cuda-sim/instructions.cc +++ b/src/cuda-sim/instructions.cc @@ -80,11 +80,12 @@ ptx_reg_t ptx_thread_info::get_reg( const symbol *reg ) const std::string &name = reg->name(); unsigned call_uid = m_callstack.back().m_call_uid; ptx_reg_t uninit_reg; - uninit_reg.u32 = 0xDEADBEEF; + uninit_reg.u32 = 0x0; set_reg(reg, uninit_reg); // give it a value since we are going to warn the user anyway std::string file_loc = get_location(); if( !unfound_register_warned ) { - printf("GPGPU-Sim PTX: WARNING (%s) ** reading undefined register \'%s\' (cuid:%u). Setting to 0XDEADBEEF.\n", + printf("GPGPU-Sim PTX: WARNING (%s) ** reading undefined register \'%s\' (cuid:%u). Setting to 0X00000000. This is okay if you are simulating the native ISA" + "\n", file_loc.c_str(), name.c_str(), call_uid ); unfound_register_warned = true; } @@ -818,13 +819,21 @@ void atom_callback( const inst_t* inst, ptx_thread_info* thread ) const operand_info &src2 = pI->src2(); // b // Get operand values - src1_data = thread->get_operand_value(src1, dst, to_type, thread, 1); // a - src2_data = thread->get_operand_value(src2, dst, to_type, thread, 1); // b + if (dst.get_symbol()->type()){ + src1_data = thread->get_operand_value(src1, dst, to_type, thread, 1); // a + src2_data = thread->get_operand_value(src2, dst, to_type, thread, 1); // b + } else { + //This is the case whent he first argument (dest) is '_' + src1_data = thread->get_operand_value(src1, src1, to_type, thread, 1); // a + src2_data = thread->get_operand_value(src2, src1, to_type, thread, 1); // b + } // Copy value pointed to in operand 'a' into register 'd' // (i.e. copy src1_data to dst) thread->get_global_memory()->read(src1_data.u32,size/8,&data.s64); - thread->set_operand_value(dst, data, to_type, thread, pI); // Write value into register 'd' + if (dst.get_symbol()->type()){ + thread->set_operand_value(dst, data, to_type, thread, pI); // Write value into register 'd' + } // Get the atomic operation to be performed unsigned m_atomic_spec = pI->get_atomic(); @@ -1080,7 +1089,12 @@ void atom_impl( const ptx_instruction *pI, ptx_thread_info *thread ) const operand_info &src1 = pI->src1(); const operand_info &dst = pI->dst(); unsigned i_type = pI->get_type(); - ptx_reg_t src1_data = thread->get_operand_value(src1, dst, i_type, thread, 1); + ptx_reg_t src1_data; + if (dst.get_symbol()->type()){ + src1_data = thread->get_operand_value(src1, dst, i_type, thread, 1); + } else { + src1_data = thread->get_operand_value(src1, src1, i_type, thread, 1); + } memory_space_t space = pI->get_space(); @@ -1944,10 +1958,10 @@ void ex2_impl( const ptx_instruction *pI, ptx_thread_info *thread ) } void exit_impl( const ptx_instruction *pI, ptx_thread_info *thread ) -{ +{ + thread->set_done(); thread->exitCore(); thread->registerExit(); - thread->set_done(); } void mad_def( const ptx_instruction *pI, ptx_thread_info *thread ); @@ -2755,9 +2769,9 @@ void ret_impl( const ptx_instruction *pI, ptx_thread_info *thread ) { bool empty = thread->callstack_pop(); if( empty ) { + thread->set_done(); thread->exitCore(); thread->registerExit(); - thread->set_done(); } } @@ -2766,9 +2780,9 @@ void retp_impl( const ptx_instruction *pI, ptx_thread_info *thread ) { bool empty = thread->callstack_pop_plus(); if( empty ) { + thread->set_done(); thread->exitCore(); thread->registerExit(); - thread->set_done(); } } -- cgit v1.3