summaryrefslogtreecommitdiff
path: root/src/dram.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-14 23:40:25 -0400
committerbd <bdunahu@operationnull.com>2025-04-14 23:40:25 -0400
commita7620015acc2401165b4587cbb6c9a118d944493 (patch)
tree5bbe698fe42a7d32578df6170e464508a78a8e50 /src/dram.cc
parent2140a23041d3920e001457f2c2acb0853094963d (diff)
Add preprocess method to storage, removing nearly all duplication
Diffstat (limited to 'src/dram.cc')
-rw-r--r--src/dram.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/dram.cc b/src/dram.cc
index 5e7e57a..bbd18b7 100644
--- a/src/dram.cc
+++ b/src/dram.cc
@@ -54,13 +54,7 @@ Dram::load(std::vector<signed int> program)
int
Dram::process(void *id, int address, std::function<void(int line, int word)> request_handler)
{
- if (id == nullptr)
- throw std::invalid_argument("Accessor cannot be nullptr.");
-
- if (this->current_request == nullptr)
- this->current_request = id;
-
- if (this->current_request != id)
+ if (!preprocess(id))
return 0;
if (!this->is_data_ready())