summaryrefslogtreecommitdiff
path: root/src/storage/storage.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-10 10:28:28 -0400
committerGitHub <noreply@github.com>2025-03-10 10:28:28 -0400
commit66edce63597093cf5f3afa5b577fd9e3ecae0ef6 (patch)
treea0b0df4fff6f7d680901cd6007df67b15b3df3b6 /src/storage/storage.cc
parent92b41d1a8b970c46b0c6d2d8d538c68855a4de25 (diff)
parent1f8b8babcfb383f1fb0281663561161061684206 (diff)
Merge pull request #19 from bdunahu/bdunahu
cache store, handle load requests to memory, write allocate policy -- changes look good
Diffstat (limited to 'src/storage/storage.cc')
-rw-r--r--src/storage/storage.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index e3067a2..61531d1 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -13,20 +13,12 @@ Storage::view(int base, int lines)
return ret;
}
-void Storage::do_write(signed data, int address)
-{
- int line = address / LINE_SIZE;
- int word = address % LINE_SIZE;
-
- this->data->at(line).at(word) = data;
-}
-
void Storage::resolve()
{
if (this->wait_time == 0) {
this->requester = IDLE;
this->wait_time = delay;
- } else if (this->requester != IDLE) {
+ } else if (this->requester != IDLE && !this->is_waiting) {
--this->wait_time;
}
}