summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/dram.cc
diff options
context:
space:
mode:
authorMahmoud <[email protected]>2020-05-23 22:45:28 -0400
committerMahmoud <[email protected]>2020-05-23 22:45:28 -0400
commit47e1a8a3a45203c34a93672a1b1bd742dc193183 (patch)
tree4db7185ba2d4af2bd03e1388cd15a33b95ea8562 /src/gpgpu-sim/dram.cc
parent90a36a59f5619790b7f6d80375f69d05a75c0a82 (diff)
code refomratting
Diffstat (limited to 'src/gpgpu-sim/dram.cc')
-rw-r--r--src/gpgpu-sim/dram.cc48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/gpgpu-sim/dram.cc b/src/gpgpu-sim/dram.cc
index 6f3155f..041cfce 100644
--- a/src/gpgpu-sim/dram.cc
+++ b/src/gpgpu-sim/dram.cc
@@ -207,31 +207,31 @@ dram_req_t::dram_req_t(class mem_fetch *mf, unsigned banks,
}
case BITWISE_XORING_BK_INDEX: {
// xoring bank bits with lower bits of the page
- int lbank = LOGB2(banks);
+ int lbank = LOGB2(banks);
bk = tlx.bk ^ (tlx.row & ((1 << lbank) - 1));
- break;
- }
- case IPOLY_BK_INDEX:
- {
- /*IPOLY for bank indexing function from "Pseudo-randomly interleaved memory."
- * Rau, B. R et al.
- * ISCA 1991
- * http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=348DEA37A3E440473B3C075EAABC63B6?doi=10.1.1.12.7149&rep=rep1&type=pdf
- */
- if (banks == 16) {
- std::bitset<64> 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 IPOLY_BK_INDEX: {
+ /*IPOLY for bank indexing function from "Pseudo-randomly interleaved
+ * memory." Rau, B. R et al. ISCA 1991
+ * http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=348DEA37A3E440473B3C075EAABC63B6?doi=10.1.1.12.7149&rep=rep1&type=pdf
+ */
+ if (banks == 16) {
+ std::bitset<64> 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: