summaryrefslogtreecommitdiff
path: root/src/storage/storage.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-08 12:51:01 -0500
committerbd <bdunahu@operationnull.com>2025-03-08 12:51:01 -0500
commit2c424d29fd813b1fbef3b07595713611a1684903 (patch)
treefc5e0f85af22003dce16abd06a131cac7c1d8b5c /src/storage/storage.cc
parentc5f26a0bfdaafc8d49c88d2016df1724b64e5271 (diff)
enforce single unit per clock cycle, order to serve storage requests
Diffstat (limited to 'src/storage/storage.cc')
-rw-r--r--src/storage/storage.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index 024699b..429ac2b 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -18,6 +18,15 @@ void Storage::do_write(signed data, int address)
int line = address / LINE_SIZE;
int word = address % LINE_SIZE;
- this->servicing = IDLE;
this->data->at(line).at(word) = data;
}
+
+void Storage::resolve()
+{
+ if (this->wait_time == 0) {
+ this->deque.pop_front();
+ this->wait_time = delay;
+ } else {
+ --this->wait_time;
+ }
+}