Skip to content

Commit 1798982

Browse files
committed
correct the code section to decide bypass, rather than global bypass
1 parent fdf6a54 commit 1798982

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/gpgpu-sim/gpu-cache.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,10 @@ void tag_array::fill(new_addr_type addr, unsigned time, //on-fill
624624

625625
bool isBypassed = false;
626626
int threshold = 8; // From SDBP paper
627-
if(l1d_prediction_table[get_hashed_pc_from_tag(addr,NULL)] >= threshold){
627+
// if(l1d_prediction_table[get_hashed_pc_from_tag(addr,NULL)] >= threshold){
628+
// isBypassed = true;
629+
// }
630+
if(l1d_prediction_table[hashed_pc] >= threshold){
628631
isBypassed = true;
629632
}
630633

@@ -638,6 +641,9 @@ void tag_array::fill(new_addr_type addr, unsigned time, //on-fill
638641
bool before = m_lines[idx]->is_modified_line();
639642
// assert(status==MISS||status==SECTOR_MISS); // MSHR should have prevented
640643
// redundant memory request
644+
645+
if(!isBypassed){ // cwpeng
646+
641647
if (status == MISS) {
642648
m_lines[idx]->allocate(m_config.tag(addr), m_config.block_addr(addr), time,
643649
mask);
@@ -653,6 +659,11 @@ void tag_array::fill(new_addr_type addr, unsigned time, //on-fill
653659
if (m_lines[idx]->is_modified_line() && !before) {
654660
m_dirty++;
655661
}
662+
663+
}
664+
else{
665+
printf("Bypass L1D due to high miss rate prediction pc:%u, pred:%u\n", hashed_pc, l1d_prediction_table[hashed_pc]);
666+
}
656667
}
657668

658669
void tag_array::fill(unsigned index, unsigned time, mem_fetch *mf) { //on-miss

src/gpgpu-sim/shader.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,10 +2879,10 @@ void ldst_unit::cycle() {
28792879
mf->get_access_type() ==
28802880
GLOBAL_ACC_W) { // global memory access
28812881
if (m_core->get_config()->gmem_skip_L1D) bypassL1D = true;
2882-
if (m_L1D->prediction_table[temp_pc] >= 8 && mf->get_access_type() == GLOBAL_ACC_R){
2883-
bypassL1D = true;
2884-
printf("Bypass L1D due to high miss rate prediction pc:%u, pred:%u\n", temp_pc, m_L1D->prediction_table[temp_pc]);
2885-
}
2882+
// if (m_L1D->prediction_table[temp_pc] >= 8 && mf->get_access_type() == GLOBAL_ACC_R){
2883+
// bypassL1D = true;
2884+
// printf("Bypass L1D due to high miss rate prediction pc:%u, pred:%u\n", temp_pc, m_L1D->prediction_table[temp_pc]);
2885+
// }
28862886
}
28872887
if (bypassL1D) {
28882888
if (m_next_global == NULL) {

0 commit comments

Comments
 (0)