summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2012-07-18 13:10:00 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:47:33 -0700
commit896e5c9a34e1b1230a67fb714d8290cd6f7f979b (patch)
tree801c1e79f99388d9715f82992550eeba49f516cb
parent9d4be38c4ef49b344e539bcd1f4ec1273d1d7759 (diff)
- print out instructions at branch divergence/reconvergence points (more informative)
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13399]
-rw-r--r--CHANGES1
-rw-r--r--src/cuda-sim/cuda-sim.cc16
-rw-r--r--src/cuda-sim/ptx_ir.cc3
-rw-r--r--src/cuda-sim/ptx_ir.h2
4 files changed, 18 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 2c3deb6..2da61e0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,7 @@ Version 3.1.0+edits (development branch) versus 3.1.0
- Added TeslaC2050 configuration.
- Added a two level warp scheduler (as presented at ISCA 2012 tutorial).
- Cleaner makedepend that doesn't interfere with Makefiles
+- Print out instructions at branch divergence/reconvergence points
- 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.
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index e08e521..252b230 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -267,12 +267,12 @@ void function_info::ptx_assemble()
print_ipostdominators();
}
- printf("GPGPU-Sim PTX: pre-decoding instructions for \'%s\'... ", m_name.c_str() );
+ printf("GPGPU-Sim PTX: pre-decoding instructions for \'%s\'...\n", m_name.c_str() );
for ( unsigned ii=0; ii < n; ii += m_instr_mem[ii]->inst_size() ) { // handle branch instructions
ptx_instruction *pI = m_instr_mem[ii];
pI->pre_decode();
}
- printf(" done.\n");
+ printf("GPGPU-Sim PTX: ... done pre-decoding instructions for \'%s\'.\n", m_name.c_str() );
fflush(stdout);
m_assembled = true;
@@ -1785,8 +1785,16 @@ struct rec_pts find_reconvergence_points( function_info *finfo )
gpgpu_recon_t *kernel_recon_points = (struct gpgpu_recon_t*) calloc(num_recon, sizeof(struct gpgpu_recon_t));
finfo->get_reconvergence_pairs(kernel_recon_points);
printf("GPGPU-Sim PTX: Reconvergence Pairs for %s\n", finfo->get_name().c_str() );
- for (int i=0;i<num_recon;i++)
- printf("GPGPU-Sim PTX: branch pc = %d\ttarget pc = %d\n", kernel_recon_points[i].source_pc, kernel_recon_points[i].target_pc);
+ for (int i=0;i<num_recon;i++) {
+ printf("GPGPU-Sim PTX: branch pc = %4d : ", kernel_recon_points[i].source_pc );
+ kernel_recon_points[i].source_inst->print_insn();
+ printf("\n");
+ printf("GPGPU-Sim PTX: target pc = %4d : ", kernel_recon_points[i].target_pc );
+ if( kernel_recon_points[i].target_inst )
+ kernel_recon_points[i].target_inst->print_insn();
+ printf("\n");
+ }
+
tmp.s_kernel_recon_points = kernel_recon_points;
tmp.s_num_recon = num_recon;
g_rpts[finfo] = tmp;
diff --git a/src/cuda-sim/ptx_ir.cc b/src/cuda-sim/ptx_ir.cc
index 50669b6..102ae40 100644
--- a/src/cuda-sim/ptx_ir.cc
+++ b/src/cuda-sim/ptx_ir.cc
@@ -783,14 +783,17 @@ void function_info::get_reconvergence_pairs(gpgpu_recon_t* recon_points)
fflush(stdout);
#endif
recon_points[idx].source_pc = m_basic_blocks[i]->ptx_end->get_PC();
+ recon_points[idx].source_inst = m_basic_blocks[i]->ptx_end;
#ifdef DEBUG_GET_RECONVERG_PAIRS
printf("\trecon_points[idx].source_pc=%d\n", recon_points[idx].source_pc);
#endif
if( m_basic_blocks[m_basic_blocks[i]->immediatepostdominator_id]->ptx_begin ) {
recon_points[idx].target_pc = m_basic_blocks[m_basic_blocks[i]->immediatepostdominator_id]->ptx_begin->get_PC();
+ recon_points[idx].target_inst = m_basic_blocks[m_basic_blocks[i]->immediatepostdominator_id]->ptx_begin;
} else {
// reconverge after function return
recon_points[idx].target_pc = -2;
+ recon_points[idx].target_inst = NULL;
}
#ifdef DEBUG_GET_RECONVERG_PAIRS
m_basic_blocks[m_basic_blocks[i]->immediatepostdominator_id]->ptx_begin->print_insn();
diff --git a/src/cuda-sim/ptx_ir.h b/src/cuda-sim/ptx_ir.h
index 1c945d7..737a610 100644
--- a/src/cuda-sim/ptx_ir.h
+++ b/src/cuda-sim/ptx_ir.h
@@ -747,6 +747,8 @@ struct basic_block_t {
struct gpgpu_recon_t {
address_type source_pc;
address_type target_pc;
+ class ptx_instruction* source_inst;
+ class ptx_instruction* target_inst;
};
class ptx_instruction : public warp_inst_t {