Skip to content

Commit

Permalink
bug fix (gpu barrier)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejchung0406 committed Feb 29, 2024
1 parent 3bf5a4d commit 9262478
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/process_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void process_manager_c::setup_process(process_s *process) {
} else if (trace_type == "nvbit") {
if (!(trace_config_file >> process->m_max_block))
ASSERTM(0, "error reading from file:%s", trace_info_file_name.c_str());
// process->m_max_block = *m_simBase->m_knobs->KNOB_MAX_BLOCK_PER_CORE;
process->m_max_block = *m_simBase->m_knobs->KNOB_MAX_BLOCK_PER_CORE;
}

// get thread count
Expand Down Expand Up @@ -639,7 +639,8 @@ void process_manager_c::setup_process(process_s *process) {

// TODO (jaekyu, 1-30-2009)
// FIXME
if (trace_type == "ptx" && *KNOB(KNOB_BLOCKS_TO_SIMULATE)) {
// euijun
if ((trace_type == "ptx" || trace_type == "nvbit") && *KNOB(KNOB_BLOCKS_TO_SIMULATE)) {
if ((*KNOB(KNOB_BLOCKS_TO_SIMULATE) * m_simBase->m_no_threads_per_block) <
static_cast<unsigned int>(thread_count)) {
uns temp = thread_count;
Expand Down
24 changes: 13 additions & 11 deletions src/trace_read_nvbit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -636,15 +636,16 @@ inst_info_s *nvbit_decoder_c::convert_pinuop_to_t_uop(void *trace_info,
trace_uop[ii]->m_num_dest_regs += 1;
}

// the last uop
if (ii == (num_uop - 1) &&
trace_uop[num_uop - 1]->m_mem_type == NOT_MEM) {
if (pi->m_opcode == NVBIT_BAR) {
// only the last instruction will have bar type - this is in case of
// CPU, in case of GPU there is always only one uop?
trace_uop[(num_uop - 1)]->m_bar_type = BAR_FETCH;
}
}
// NVBit trace tool does not support yet... (euijun Feb 28 2024)
// // the last uop
// if (ii == (num_uop - 1) &&
// trace_uop[num_uop - 1]->m_mem_type == NOT_MEM) {
// if (pi->m_opcode == NVBIT_BAR) {
// // only the last instruction will have bar type - this is in case of
// // CPU, in case of GPU there is always only one uop?
// trace_uop[(num_uop - 1)]->m_bar_type = BAR_FETCH;
// }
// }

// update instruction information with MacSim trace
convert_t_uop_to_info(trace_uop[ii], info);
Expand Down Expand Up @@ -765,6 +766,7 @@ bool nvbit_decoder_c::get_uops_from_traces(int core_id, uop_c *uop,
///
/// BOM (beginning of macro) : need to get a next instruction
///

if (thread_trace_info->m_bom) {
bool inst_read; // indicate new instruction has been read from a trace file

Expand Down Expand Up @@ -1006,8 +1008,8 @@ bool nvbit_decoder_c::get_uops_from_traces(int core_id, uop_c *uop,
ASSERT((index + 1) < MAX_PUP);
if (thread_trace_info->m_trace_uop_array[++index]->m_mem_type) {
ASSERTM(0,
"this condition is not handled in the code (and should never "
"occur?)!");
"this condition is not handled in the code (and should never "
"occur?)!");
}
if (thread_trace_info->m_trace_uop_array[++index]->m_eom) {
break;
Expand Down

0 comments on commit 9262478

Please sign in to comment.