diff options
author | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-03-09 11:39:59 -0400 |
---|---|---|
committer | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-03-09 11:39:59 -0400 |
commit | 01332f67ddb66a151eb31269fa82961ba71f4c97 (patch) | |
tree | 48d34db1bf24205d971cc25c63dfe6f5df6e341c /src/storage/dram.cc | |
parent | 212a47482c5c037720aef726fcb2b7bb3a3acd67 (diff) |
Implement dram load
Diffstat (limited to 'src/storage/dram.cc')
-rw-r--r-- | src/storage/dram.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/storage/dram.cc b/src/storage/dram.cc index 7db5676..43c092d 100644 --- a/src/storage/dram.cc +++ b/src/storage/dram.cc @@ -38,4 +38,15 @@ Response Dram::write(Accessor accessor, signed int data, int address) return r; } -Response Dram::read(Accessor accessor, int address) { return WAIT; } +Response Dram::read(Accessor accessor, int address, std::array<signed int, LINE_SIZE>& data) { + Response r = WAIT; + if (this->requester == IDLE) + this->requester = accessor; + if (this->requester == accessor) { + if (this->wait_time == 0) { + this->do_read(data, address); + r = OK; + } + } + return r; + } |