summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyub Gubran <[email protected]>2012-07-16 23:49:05 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:47:33 -0700
commita05d1c1a5abb37f129c95c92991f69f3a43158ed (patch)
tree6786c74a1ac98c88b481d1acf5aa313476240cf2
parentdc45f0ec4b16144c248fb86acc905fbb5b627300 (diff)
Fix for bug 9: Now querying the state of the pdom stack in call_imp and callp_imp using a core_t function, thus moving the querying function into the abstract model of the core instead of shader_core_ctx which represents the performance mode. This code simplify the querying and also avoid the unnecessary calling hierarchy that was used.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13375]
-rw-r--r--CHANGES1
-rw-r--r--src/abstract_hardware_model.cc5
-rw-r--r--src/abstract_hardware_model.h1
-rw-r--r--src/cuda-sim/cuda-sim.cc2
-rw-r--r--src/cuda-sim/instructions.cc8
-rw-r--r--src/gpgpu-sim/gpu-sim.h2
-rw-r--r--src/gpgpu-sim/shader.cc18
-rw-r--r--src/gpgpu-sim/shader.h2
8 files changed, 10 insertions, 29 deletions
diff --git a/CHANGES b/CHANGES
index 54b8380..2c3deb6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,7 @@ Version 3.1.0+edits (development branch) versus 3.1.0
- Added a two level warp scheduler (as presented at ISCA 2012 tutorial).
- Cleaner makedepend that doesn't interfere with Makefiles
- Bug Fixes:
+ - Fixed a bug in executing call_imp and callp_imp with the pure functional simulation mode.
- Fixed a couple of memory errors in cuobjdump_to_ptxplus code.
- Implemented better support for handling memory operand type modifier
in cuobjdump_to_ptxplus
diff --git a/src/abstract_hardware_model.cc b/src/abstract_hardware_model.cc
index 01899d5..396e45a 100644
--- a/src/abstract_hardware_model.cc
+++ b/src/abstract_hardware_model.cc
@@ -732,3 +732,8 @@ m_simt_stack = new simt_stack*[warps];
for (unsigned i = 0; i < warps; ++i)
m_simt_stack[i] = new simt_stack(i,warpsSize);
}
+
+void core_t::get_pdom_stack_top_info( unsigned warpId, unsigned *pc, unsigned *rpc ) const
+{
+ m_simt_stack[warpId]->get_pdom_stack_top_info(pc,rpc);
+}
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index a2d144f..1fc10b9 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -854,6 +854,7 @@ class core_t {
void updateSIMTStack(unsigned warpId, unsigned warpSize, warp_inst_t * inst);
void initilizeSIMTStack(unsigned warps, unsigned warpsSize);
warp_inst_t getExecuteWarp(unsigned warpId);
+ void get_pdom_stack_top_info( unsigned warpId, unsigned *pc, unsigned *rpc ) const;
protected:
class gpgpu_sim *m_gpu;
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index 752985c..e08e521 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -1609,7 +1609,7 @@ void functionalCoreSim::initializeCTA()
//get threads for a cta
for(unsigned i=0; i<m_kernel->threads_per_cta();i++) {
- ptx_sim_init_thread(*m_kernel,&m_thread[i],0,i,m_kernel->threads_per_cta()-i,m_kernel->threads_per_cta(),NULL,0,i/m_maxWarpSize,(gpgpu_t*)m_gpu, true);
+ ptx_sim_init_thread(*m_kernel,&m_thread[i],0,i,m_kernel->threads_per_cta()-i,m_kernel->threads_per_cta(),this,0,i/m_maxWarpSize,(gpgpu_t*)m_gpu, true);
assert(m_thread[i]!=NULL && !m_thread[i]->is_done());
ctaLiveThreads++;
}
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 37e5d00..6976ba0 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -1258,12 +1258,10 @@ void call_impl( const ptx_instruction *pI, ptx_thread_info *thread )
return_var_src = target_func->get_return_var();
}
- unsigned sid = thread->get_hw_sid();
- unsigned tid = thread->get_hw_tid();
gpgpu_sim *gpu = thread->get_gpu();
unsigned callee_pc=0, callee_rpc=0;
if( gpu->simd_model() == POST_DOMINATOR ) {
- gpu->get_pdom_stack_top_info(sid,tid,&callee_pc,&callee_rpc);
+ thread->get_core()->get_pdom_stack_top_info(thread->get_hw_wid(),&callee_pc,&callee_rpc);
assert( callee_pc == thread->get_pc() );
}
@@ -1286,12 +1284,10 @@ void callp_impl( const ptx_instruction *pI, ptx_thread_info *thread )
const symbol *return_var_src = NULL;
const symbol *return_var_dst = NULL;
- unsigned sid = thread->get_hw_sid();
- unsigned tid = thread->get_hw_tid();
gpgpu_sim *gpu = thread->get_gpu();
unsigned callee_pc=0, callee_rpc=0;
if( gpu->simd_model() == POST_DOMINATOR ) {
- gpu->get_pdom_stack_top_info(sid,tid,&callee_pc,&callee_rpc);
+ thread->get_core()->get_pdom_stack_top_info(thread->get_hw_wid(),&callee_pc,&callee_rpc);
assert( callee_pc == thread->get_pc() );
}
diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h
index 2c0fed8..ac2be00 100644
--- a/src/gpgpu-sim/gpu-sim.h
+++ b/src/gpgpu-sim/gpu-sim.h
@@ -245,8 +245,6 @@ public:
void update_stats();
void deadlock_check();
- void get_pdom_stack_top_info( unsigned sid, unsigned tid, unsigned *pc, unsigned *rpc );
-
int shared_mem_size() const;
int num_registers_per_core() const;
int wrp_size() const;
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 8ed907d..ddb544a 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -289,18 +289,6 @@ address_type shader_core_ctx::next_pc( int tid ) const
return the_thread->get_pc(); // PC should already be updatd to next PC at this point (was set in shader_decode() last time thread ran)
}
-void gpgpu_sim::get_pdom_stack_top_info( unsigned sid, unsigned tid, unsigned *pc, unsigned *rpc )
-{
- unsigned cluster_id = m_shader_config->sid_to_cluster(sid);
- m_cluster[cluster_id]->get_pdom_stack_top_info(sid,tid,pc,rpc);
-}
-
-void shader_core_ctx::get_pdom_stack_top_info( unsigned tid, unsigned *pc, unsigned *rpc ) const
-{
- unsigned warp_id = tid/m_config->warp_size;
- m_simt_stack[warp_id]->get_pdom_stack_top_info(pc,rpc);
-}
-
void shader_core_stats::print( FILE* fout ) const
{
unsigned icount_uarch=0;
@@ -2449,12 +2437,6 @@ void simt_core_cluster::icnt_cycle()
}
}
-void simt_core_cluster::get_pdom_stack_top_info( unsigned sid, unsigned tid, unsigned *pc, unsigned *rpc ) const
-{
- unsigned cid = m_config->sid_to_cid(sid);
- m_core[cid]->get_pdom_stack_top_info(tid,pc,rpc);
-}
-
void simt_core_cluster::display_pipeline( unsigned sid, FILE *fout, int print_mem, int mask )
{
m_core[m_config->sid_to_cid(sid)]->display_pipeline(fout,print_mem,mask);
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 5612150..558335e 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -1227,7 +1227,6 @@ public:
// accessors
virtual bool warp_waiting_at_barrier( unsigned warp_id ) const;
- void get_pdom_stack_top_info( unsigned tid, unsigned *pc, unsigned *rpc ) const;
// used by pipeline timing model components:
// modifiers
@@ -1360,7 +1359,6 @@ public:
m_response_fifo.push_back(mf);
}
- void get_pdom_stack_top_info( unsigned sid, unsigned tid, unsigned *pc, unsigned *rpc ) const;
unsigned max_cta( const kernel_info_t &kernel );
unsigned get_not_completed() const;
void print_not_completed( FILE *fp ) const;