From b417eefe0b451ac01cef794f97e548f987bf173d Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 26 Mar 2025 12:21:52 -0400 Subject: Add fetch stage implementation, tests, program loading, DTO object --- src/storage/dram.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/storage/dram.cc b/src/storage/dram.cc index 371503d..f90f8db 100644 --- a/src/storage/dram.cc +++ b/src/storage/dram.cc @@ -56,6 +56,16 @@ Response Dram::read_word(Accessor accessor, int address, signed int &data) }); } +// TODO load a file instead and test this method +void Dram::load(std::vector program) { + unsigned long i; + for (i = 0; i < program.size(); ++i) { + int line, word; + get_memory_index(i, line, word); + this->data->at(line).at(word) = program[i]; + } +} + Response Dram::process( Accessor accessor, int address, -- cgit v1.2.3