From 2f2ee7256ffd03e9bce838f74651254c1588cb39 Mon Sep 17 00:00:00 2001 From: Mahmoud Date: Wed, 16 Oct 2019 15:35:04 -0400 Subject: fixing the IPOLY L2 and Dram indexing --- src/gpgpu-sim/dram.cc | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/gpgpu-sim/dram.cc') diff --git a/src/gpgpu-sim/dram.cc b/src/gpgpu-sim/dram.cc index 9c33822..a056371 100644 --- a/src/gpgpu-sim/dram.cc +++ b/src/gpgpu-sim/dram.cc @@ -210,10 +210,33 @@ dram_req_t::dram_req_t( class mem_fetch *mf, unsigned banks, unsigned dram_bnk_i case BITWISE_XORING_BK_INDEX: { //xoring bank bits with lower bits of the page - int lbank = log2(banks); + int lbank = LOGB2(banks); bk = tlx.bk ^ (tlx.row & ((1< a(tlx.row); + std::bitset<4> b(tlx.bk); + b[0] = a[11]^a[10]^a[9]^a[8]^a[6]^a[4]^a[3]^a[0]^b[0]; + b[1] = a[12]^a[8]^a[7]^a[6]^a[5]^a[3]^a[1]^a[0]^b[1]; + b[2] = a[9]^a[8]^a[7]^a[6]^a[4]^a[2]^a[1]^b[2]; + b[3] = a[10]^a[9]^a[8]^a[7]^a[5]^a[3]^a[2]^b[3]; + bk = b.to_ulong(); + assert(bk < banks); + } + else{ /* Else incorrect number of channels for the hashing function */ + assert("\nGPGPU-Sim memory_banking indexing error: The number of banks should be " + "16 for the hashing IPOLY index function.\n" && 0); + } + break; + } case CUSTOM_BK_INDEX: /* No custom set function implemented */ //Do you custom index here -- cgit v1.3