summaryrefslogtreecommitdiff
path: root/src/dram.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dram.cc')
-rw-r--r--src/dram.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dram.cc b/src/dram.cc
index d81e2d2..2fd8a91 100644
--- a/src/dram.cc
+++ b/src/dram.cc
@@ -4,7 +4,6 @@
#include <bits/stdc++.h>
#include <bitset>
#include <iterator>
-#include <utils.h>
Dram::Dram(int delay) : Storage(delay) { this->data->resize(MEM_LINES); }
@@ -85,3 +84,10 @@ Dram::is_access_cleared(void *id)
}
return 0;
}
+
+void
+Dram::get_memory_index(int address, int &line, int &word)
+{
+ line = WRAP_ADDRESS(address) / LINE_SIZE;
+ word = address % LINE_SIZE;
+}