Skip to content

Commit 24e192b

Browse files
committed
fix no function implementation bug
1 parent f582165 commit 24e192b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/gpgpu-sim/gpu-cache.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,20 @@ enum cache_request_status tag_array::probe(new_addr_type addr, unsigned &idx,
333333
}
334334

335335
/// cwpeng
336+
uint8_t tag_array::get_hashed_pc_from_tag(new_addr_type addr, mem_fetch *mf){
337+
unsigned set_index = m_config.set_index(addr);
338+
new_addr_type tag = m_config.tag(addr);
339+
340+
// check for line in cache
341+
for (unsigned way = 0; way < m_config.m_assoc; way++) {
342+
unsigned index = set_index * m_config.m_assoc + way;
343+
cache_block_t *line = m_lines[index];
344+
if (line->m_tag == tag) {
345+
return line->m_hashed_pc;
346+
}
347+
}
348+
}
349+
336350
void tag_array::set_hashed_pc_from_tag(new_addr_type addr, mem_fetch *mf, uint8_t hashed_pc){
337351
unsigned set_index = m_config.set_index(addr);
338352
new_addr_type tag = m_config.tag(addr);

0 commit comments

Comments
 (0)