From 3322aa0845f7fe9cc98aa4e429bd5ecf72a5c27e Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 6 Mar 2025 00:34:35 -0500 Subject: dram write (no delay, no accessor tracking --- src/storage/dram.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/storage/dram.cc') diff --git a/src/storage/dram.cc b/src/storage/dram.cc index 89c7316..845db21 100644 --- a/src/storage/dram.cc +++ b/src/storage/dram.cc @@ -1,10 +1,11 @@ #include "dram.h" +#include "definitions.h" #include "response.h" #include Dram::Dram(int lines, int delay) { - this->data = new std::vector>; + this->data = new std::vector>; this->data->resize(lines); this->delay = delay; this->lower = nullptr; @@ -14,7 +15,14 @@ Dram::~Dram() { delete this->data; } Response *Dram::write(Accessor accessor, signed int data, int address) { - return new Response(); + struct Response *r = new Response(); + int line = address / LINE_SIZE; + int word = address % LINE_SIZE; + + this->data->at(line).at(word) = data; + + r->status = OK; + return r; } Response *Dram::read(Accessor accessor, int address) { return nullptr; } -- cgit v1.2.3