summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.cc
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-09-12 20:15:37 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:48:55 -0700
commit960a55b075be901ca14d1878f886bbea73456663 (patch)
tree2b6ce142fb94e49da208c9b0adf3381c834dc04e /src/abstract_hardware_model.cc
parentb9f3352b362e0ea85134cd1e1b2d45322e2145c2 (diff)
Minor refactoring for the SIMT Stack implementation and fixing some indentation
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14067]
Diffstat (limited to 'src/abstract_hardware_model.cc')
-rw-r--r--src/abstract_hardware_model.cc53
1 files changed, 28 insertions, 25 deletions
diff --git a/src/abstract_hardware_model.cc b/src/abstract_hardware_model.cc
index 7a9fcf8..a2539af 100644
--- a/src/abstract_hardware_model.cc
+++ b/src/abstract_hardware_model.cc
@@ -716,16 +716,17 @@ void simt_stack::update( simt_mask_t &thread_done, addr_vector_t &next_pc, addre
}
}
-void core_t::execute_warp_inst_t(warp_inst_t &inst, unsigned warpSize, unsigned warpId){
+void core_t::execute_warp_inst_t(warp_inst_t &inst, unsigned warpSize, unsigned warpId)
+{
for ( unsigned t=0; t < warpSize; t++ ) {
if( inst.active(t) ) {
- if(warpId==(unsigned (-1)))
- warpId = inst.warp_id();
- unsigned tid=warpSize*warpId+t;
- m_thread[tid]->ptx_exec_inst(inst,t);
-
- //virtual function
- checkExecutionStatusAndUpdate(inst,t,tid);
+ if(warpId==(unsigned (-1)))
+ warpId = inst.warp_id();
+ unsigned tid=warpSize*warpId+t;
+ m_thread[tid]->ptx_exec_inst(inst,t);
+
+ //virtual function
+ checkExecutionStatusAndUpdate(inst,t,tid);
}
}
}
@@ -735,25 +736,27 @@ bool core_t::ptx_thread_done( unsigned hw_thread_id ) const
return ((m_thread[ hw_thread_id ]==NULL) || m_thread[ hw_thread_id ]->is_done());
}
-void core_t::updateSIMTStack(unsigned warpId, unsigned warpSize, warp_inst_t * inst){
-simt_mask_t thread_done;
-addr_vector_t next_pc;
-unsigned wtid = warpId * warpSize;
-for (unsigned i = 0; i < warpSize; i++) {
- if( ptx_thread_done(wtid+i) ) {
- thread_done.set(i);
- next_pc.push_back( (address_type)-1 );
- } else {
- if( inst->reconvergence_pc == RECONVERGE_RETURN_PC )
- inst->reconvergence_pc = get_return_pc(m_thread[wtid+i]);
- next_pc.push_back( m_thread[wtid+i]->get_pc() );
- }
-}
-m_simt_stack[warpId]->update(thread_done,next_pc,inst->reconvergence_pc, inst->op);
+void core_t::updateSIMTStack(unsigned warpId, unsigned warpSize, warp_inst_t * inst)
+{
+ simt_mask_t thread_done;
+ addr_vector_t next_pc;
+ unsigned wtid = warpId * warpSize;
+ for (unsigned i = 0; i < warpSize; i++) {
+ if( ptx_thread_done(wtid+i) ) {
+ thread_done.set(i);
+ next_pc.push_back( (address_type)-1 );
+ } else {
+ if( inst->reconvergence_pc == RECONVERGE_RETURN_PC )
+ inst->reconvergence_pc = get_return_pc(m_thread[wtid+i]);
+ next_pc.push_back( m_thread[wtid+i]->get_pc() );
+ }
+ }
+ m_simt_stack[warpId]->update(thread_done,next_pc,inst->reconvergence_pc, inst->op);
}
//! Get the warp to be executed using the data taken form the SIMT stack
-warp_inst_t core_t::getExecuteWarp(unsigned warpId){
+warp_inst_t core_t::getExecuteWarp(unsigned warpId)
+{
unsigned pc,rpc;
m_simt_stack[warpId]->get_pdom_stack_top_info(&pc,&rpc);
warp_inst_t wi= *ptx_fetch_inst(pc);
@@ -763,7 +766,7 @@ warp_inst_t core_t::getExecuteWarp(unsigned warpId){
void core_t::initilizeSIMTStack(unsigned warps, unsigned warpsSize)
{
-m_simt_stack = new simt_stack*[warps];
+ m_simt_stack = new simt_stack*[warps];
for (unsigned i = 0; i < warps; ++i)
m_simt_stack[i] = new simt_stack(i,warpsSize);
}