Skip to content

Commit 37c26be

Browse files
committed
show instruction and related PC at beginning and modify PC hash function
1 parent 41f9347 commit 37c26be

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/cuda-sim/cuda-sim.cc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,28 @@ void function_info::ptx_assemble() {
350350
printf(" done.\n");
351351
fflush(stdout);
352352

353+
// Print PC to instruction mapping for all instructions
354+
355+
printf("\n");
356+
357+
printf("GPGPU-Sim PTX: PC to Instruction Mapping for \'%s\':\n", m_name.c_str());
358+
359+
printf("=================================================================\n");
360+
361+
for (unsigned ii = 0; ii < n; ii += m_instr_mem[ii]->inst_size()) {
362+
363+
ptx_instruction *pI = m_instr_mem[ii];
364+
365+
addr_t inst_pc = pI->get_PC();
366+
367+
printf(" PC=0x%03llx: %s\n", inst_pc, pI->get_source());
368+
369+
}
370+
371+
printf("=================================================================\n");
372+
373+
fflush(stdout) ;
374+
353375
// disable pdom analysis here and do it at runtime
354376
#if 0
355377
printf("GPGPU-Sim PTX: finding reconvergence points for \'%s\'...\n", m_name.c_str() );

src/gpgpu-sim/gpu-cache.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2528,7 +2528,7 @@ enum cache_request_status l1_cache::access(new_addr_type addr, mem_fetch *mf,
25282528
}
25292529

25302530
uint8_t l1_cache::pc2hashed_pc(new_addr_type addr){ // cwpeng PC -> 256bit hash PC translation
2531-
return (addr >> 2) % 256 ;
2531+
return (addr >> 3) % 256 ;
25322532
}
25332533

25342534
// The l2 cache access function calls the base data_cache access

0 commit comments

Comments
 (0)