summaryrefslogtreecommitdiff
path: root/src/storage
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-06 01:35:27 -0500
committerbd <bdunahu@operationnull.com>2025-03-06 01:35:27 -0500
commit3221a2c310afb6ed124d6b67afda110d4b8dcade (patch)
tree11889ec161e7cc76e71967cd2920279d36e46910 /src/storage
parente3e70b16d27b6972d6fe6f032426b889b03d1aef (diff)
Allow sidedoor free access to writing memory
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/dram.cc31
-rw-r--r--src/storage/storage.cc9
2 files changed, 25 insertions, 15 deletions
diff --git a/src/storage/dram.cc b/src/storage/dram.cc
index 3143a61..3eb0748 100644
--- a/src/storage/dram.cc
+++ b/src/storage/dram.cc
@@ -19,22 +19,23 @@ Response *Dram::write(Accessor accessor, signed int data, int address)
struct Response *r = new Response();
r->status = WAIT;
- /* Do this first--then process the first cycle immediately. */
- if (this->servicing == IDLE) {
- this->servicing = accessor;
- this->wait_time = delay;
- }
-
- if (this->servicing == accessor) {
- if (this->wait_time == 0) {
- int line = address / LINE_SIZE;
- int word = address % LINE_SIZE;
+ if (accessor == SIDE) {
+ this->do_write(data, address);
+ r->status = OK;
+ } else {
+ /* Do this first--then process the first cycle immediately. */
+ if (this->servicing == IDLE) {
+ this->servicing = accessor;
+ this->wait_time = delay;
+ }
- this->servicing = IDLE;
- this->data->at(line).at(word) = data;
- r->status = OK;
- } else {
- --this->wait_time;
+ if (this->servicing == accessor) {
+ if (this->wait_time == 0) {
+ this->do_write(data, address);
+ r->status = OK;
+ } else {
+ --this->wait_time;
+ }
}
}
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index a9a883a..024699b 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -12,3 +12,12 @@ Storage::view(int base, int lines)
ret.begin());
return ret;
}
+
+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;
+}