summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-08 15:19:57 -0500
committerbd <bdunahu@operationnull.com>2025-03-08 15:19:57 -0500
commitdcc22079fc1c455df70ab1263ea09400e4c948d6 (patch)
treea55d0f640d9eb94c58ac25cf5c551c0d7506e43e /src
parent8fc631090fd88a7e8e62f284c3dfd3c515d14613 (diff)
Remove queue in storage.h
Diffstat (limited to 'src')
-rw-r--r--src/storage/dram.cc5
-rw-r--r--src/storage/storage.cc4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/storage/dram.cc b/src/storage/dram.cc
index 5b4c63b..7197668 100644
--- a/src/storage/dram.cc
+++ b/src/storage/dram.cc
@@ -23,9 +23,10 @@ Response Dram::write(Accessor accessor, signed int data, int address)
r = OK;
} else {
/* Do this first--then process the first cycle immediately. */
- this->deque.push_back(accessor);
+ if (this->requester == IDLE)
+ this->requester = accessor;
- if (this->deque.front() == accessor) {
+ if (this->requester == accessor) {
if (this->wait_time == 0) {
this->do_write(data, address);
r = OK;
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index 429f8aa..e3067a2 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -24,9 +24,9 @@ void Storage::do_write(signed data, int address)
void Storage::resolve()
{
if (this->wait_time == 0) {
- this->deque.pop_front();
+ this->requester = IDLE;
this->wait_time = delay;
- } else if (!this->deque.empty()) {
+ } else if (this->requester != IDLE) {
--this->wait_time;
}
}