Skip to content

Commit b2a6751

Browse files
committed
only one sector request to L2 have the chance to send/change bypassbit
1 parent c060044 commit b2a6751

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/gpgpu-sim/gpu-cache.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ bool tag_array::get_bypass_bit_from_tag(new_addr_type addr, mem_fetch *mf){
521521
return line->m_bypassBit;
522522
}
523523
}
524+
return false;
524525
}
525526

526527

@@ -572,6 +573,7 @@ enum cache_request_status tag_array::access(new_addr_type addr, unsigned time,
572573
}
573574
m_lines[idx]->allocate(m_config.tag(addr), m_config.block_addr(addr),
574575
time, mf->get_access_sector_mask());
576+
m_lines[idx]->m_bypassBit = false;
575577
}
576578
break;
577579
case SECTOR_MISS:
@@ -624,6 +626,7 @@ void tag_array::fill(new_addr_type addr, unsigned time, //on-fill
624626
if (status == MISS) {
625627
m_lines[idx]->allocate(m_config.tag(addr), m_config.block_addr(addr), time,
626628
mask);
629+
m_lines[idx]->m_bypassBit = false;
627630
} else if (status == SECTOR_MISS) {
628631
assert(m_config.m_cache_type == SECTOR);
629632
((sector_cache_block *)m_lines[idx])->allocate_sector(time, mask);
@@ -675,7 +678,7 @@ void tag_array::fill(new_addr_type addr, unsigned time, //on-fill
675678
}
676679
if(isBypassed){
677680
if(bypassBit){
678-
printf("L2 indicate misprediction, bypassbit = 1, PC=%llx\n", mf->get_pc()); ;
681+
// printf("L2 indicate misprediction, bypassbit = 1, PC=%llx\n", mf->get_pc()); ;
679682
// l1d_prediction_table[hashed_pc] = threshold-1 ;
680683
isBypassed = false ; // if L2 indicates misprediction, do not bypass
681684
l1_cache::inst_stats[hashed_pc].misprediction_time++ ;
@@ -720,6 +723,7 @@ void tag_array::fill(new_addr_type addr, unsigned time, //on-fill
720723
if (status == MISS) {
721724
m_lines[idx]->allocate(m_config.tag(addr), m_config.block_addr(addr), time,
722725
mask);
726+
m_lines[idx]->m_bypassBit = false;
723727
} else if (status == SECTOR_MISS) {
724728
assert(m_config.m_cache_type == SECTOR);
725729
((sector_cache_block *)m_lines[idx])->allocate_sector(time, mask);

src/gpgpu-sim/l2cache.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ void memory_sub_partition::cache_cycle(unsigned cycle) {
554554
// m_L2cache->set_bypass_bit_from_l2(mf->get_addr(), mf, isBypassed);
555555
// }
556556
m_L2cache->set_bypass_bit_from_l2(mf->get_addr(), mf, isBypassed);
557+
558+
// assert(bypassBit) ;
559+
560+
// mf->set_bypassBit(true);
557561
}
558562

559563
mf->set_reply();
@@ -749,6 +753,11 @@ memory_sub_partition::breakdown_request_to_sector_requests(mem_fetch *mf) {
749753
std::bitset<SECTOR_CHUNCK_SIZE>().set(i), SECTOR_SIZE, mf->is_write(),
750754
m_gpu->gpu_tot_sim_cycle + m_gpu->gpu_sim_cycle, mf->get_wid(),
751755
mf->get_sid(), mf->get_tpc(), mf, mf->get_streamID());
756+
757+
if(i == 0){
758+
n_mf->set_L1toL2(mf->get_L1toL2());
759+
n_mf->set_isBypassed(mf->get_isBypassed());
760+
}
752761

753762
result.push_back(n_mf);
754763
}

src/gpgpu-sim/mem_fetch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ class mem_fetch {
137137
void set_bypassBit(bool val) { m_bypassBit = val ; } // cwpeng
138138
bool get_bypassBit() { return m_bypassBit ; }
139139

140+
bool L2toL1 = false ; // cwpeng: indicate this mf is from L2 to L1
141+
140142
private:
141143
// request source information
142144
unsigned m_request_uid;

0 commit comments

Comments
 (0)