summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/storage/cache.cc7
-rw-r--r--src/storage/dram.cc8
-rw-r--r--src/storage/storage.cc10
3 files changed, 15 insertions, 10 deletions
diff --git a/src/storage/cache.cc b/src/storage/cache.cc
index cf954b0..e0eaf58 100644
--- a/src/storage/cache.cc
+++ b/src/storage/cache.cc
@@ -24,8 +24,9 @@ Response Cache::write(Accessor accessor, signed int data, int address)
this->requester = accessor;
if (this->requester == accessor) {
+ fetch_resource(address);
if (this->wait_time == 0) {
- this->do_write(data, address);
+ // this->do_write(data, address);
r = OK;
}
}
@@ -34,3 +35,7 @@ Response Cache::write(Accessor accessor, signed int data, int address)
}
Response Cache::read(Accessor accessor, int address, std::array<signed int, LINE_SIZE>& data) { return WAIT; }
+
+void Cache::fetch_resource(int address) {
+
+}
diff --git a/src/storage/dram.cc b/src/storage/dram.cc
index 0db4c35..e3f3c9a 100644
--- a/src/storage/dram.cc
+++ b/src/storage/dram.cc
@@ -15,6 +15,14 @@ Dram::Dram(int lines, int delay)
Dram::~Dram() { delete this->data; }
+void Dram::do_write(signed data, int address)
+{
+ int line = address / LINE_SIZE;
+ int word = address % LINE_SIZE;
+
+ this->data->at(line).at(word) = data;
+}
+
Response Dram::write(Accessor accessor, signed int data, int address)
{
Response r = WAIT;
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index e3067a2..f382b3e 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_blocked) {
--this->wait_time;
}
}