Skip to content

Commit 36f08ab

Browse files
committed
finish implementation paper
1 parent c7ebf5f commit 36f08ab

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/gpgpu-sim/gpu-cache.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,12 @@ void tag_array::fill(new_addr_type addr, unsigned time, //on-fill
646646
if(isBypassed){
647647
if(bypassBit){
648648
printf("L2 indicate misprediction, bypassbit = 1\n") ;
649-
l1d_prediction_table[hashed_pc] = threshold-1 ;
649+
// l1d_prediction_table[hashed_pc] = threshold-1 ;
650650
isBypassed = false ; // if L2 indicates misprediction, do not bypass
651651
}
652652
}
653+
654+
// isBypassed = false ;
653655

654656

655657
if(l1d_prediction_table[m_lines[idx]->m_hashed_pc] < 15 && victim_valid && isBypassed==false) //&& m_tag_array->get_hashed_pc_from_tag(addr)->is_valid_line()) // AISH Saturating counter stays at 15
@@ -2198,11 +2200,15 @@ enum cache_request_status data_cache::rd_hit_base_l1d(
21982200
new_addr_type block_addr = m_config.block_addr(addr);
21992201

22002202
uint8_t storedhashedPC = m_tag_array->get_hashed_pc_from_tag(addr, mf); // Rajesh CS752
2201-
// printf("HashPC: %d %d\n", storedhashedPC, mf->get_pc()); ;
2203+
printf("HashPC: %d %d\n", storedhashedPC, mf->get_pc()); ;
22022204
if(l1d_prediction_table[storedhashedPC] > 0 ){ // Saturating counter stays 0 on 0
22032205
l1d_prediction_table[storedhashedPC]--;
22042206
//fprintf(stdout,"HIT Time: %d PC: %d Value: %d\n", time, storedhashedPC, l1d_prediction_table[storedhashedPC]);
22052207
}
2208+
// if(l1d_prediction_table[mf->get_pc()%256] > 0 ){ // Saturating counter stays 0 on 0
2209+
// l1d_prediction_table[mf->get_pc()%256]--;
2210+
// //fprintf(stdout,"HIT Time: %d PC: %d Value: %d\n", time, storedhashedPC, l1d_prediction_table[storedhashedPC]);
2211+
// }
22062212
printf("CWPENG: PC:%d hit, update table[%d] to %d, ptr:%p\n", mf->get_pc()%256, storedhashedPC, l1d_prediction_table[storedhashedPC], l1d_prediction_table) ;
22072213
m_tag_array->set_hashed_pc_from_tag(addr, mf, (uint8_t) mf->get_pc()); //cwpeng
22082214

src/gpgpu-sim/l2cache.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,12 @@ void memory_sub_partition::cache_cycle(unsigned cycle) {
546546
bool isBypassed = mf->get_isBypassed();
547547
bool bypassBit = m_L2cache->get_bypass_bit_from_l2(mf->get_addr(), mf); // Read existing bypass bit from L2
548548
mf->set_bypassBit(bypassBit); // Set the bypass bit in mf to be sent back to L1
549+
// if(bypassBit){
550+
// m_L2cache->set_bypass_bit_from_l2(mf->get_addr(), mf, false);
551+
// }
552+
// else{
553+
// m_L2cache->set_bypass_bit_from_l2(mf->get_addr(), mf, isBypassed);
554+
// }
549555
m_L2cache->set_bypass_bit_from_l2(mf->get_addr(), mf, isBypassed);
550556
}
551557

@@ -723,7 +729,7 @@ bool memory_sub_partition::busy() const { return !m_request_tracker.empty(); }
723729

724730
std::vector<mem_fetch *>
725731
memory_sub_partition::breakdown_request_to_sector_requests(mem_fetch *mf) {
726-
// printf("L2 access data size: %d\n", mf->get_data_size());
732+
// printf("L2 access data size: %d, from L1? %b\n", mf->get_data_size(), mf->get_L1toL2());
727733
std::vector<mem_fetch *> result;
728734
mem_access_sector_mask_t sector_mask = mf->get_access_sector_mask();
729735
if (mf->get_data_size() == SECTOR_SIZE &&

0 commit comments

Comments
 (0)