summaryrefslogtreecommitdiff
path: root/inc/dram.h
diff options
context:
space:
mode:
authorbd <bdunaisky@umass.edu>2025-03-11 21:16:25 +0000
committerGitHub <noreply@github.com>2025-03-11 21:16:25 +0000
commit92e8c2583695a3bf652e0e8dedb79e7a99922f5f (patch)
tree0574ee516499001244d33785a5fc380801c557c9 /inc/dram.h
parent33c7c78b1c65c375d0291fd435e02ddc9d35681b (diff)
parent5f13f583e373bb02b7bf20cbcc9298dc1480a697 (diff)
Merge pull request #25 from bdunahu/dev-sid
support for read word, write line in all levels of storage, cache load, dirty cache eviction, memory address wrapping
Diffstat (limited to 'inc/dram.h')
-rw-r--r--inc/dram.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/inc/dram.h b/inc/dram.h
index 2d4088f..2771c3e 100644
--- a/inc/dram.h
+++ b/inc/dram.h
@@ -17,21 +17,37 @@ class Dram : public Storage
Dram(int lines, int delay);
~Dram();
- Response write(Accessor accessor, signed int data, int address) override;
- Response read(
+ Response
+ write_word(Accessor accessor, signed int data, int address) override;
+ Response read_line(
Accessor accessor,
int address,
- std::array<signed int, LINE_SIZE> &data) override;
+ std::array<signed int, LINE_SIZE> &data_line) override;
+ Response write_line(
+ Accessor accessor,
+ std::array<signed int, LINE_SIZE> data_line,
+ int address) override;
+ Response
+ read_word(Accessor accessor, int address, signed int &data) override;
private:
/**
- * Helper for `write`.
+ * Helper for `write` a word
*/
void do_write(signed int, int);
/**
- * Helper for `read`.
+ * Helper for writing a line.
+ */
+ void
+ do_write_line(std::array<signed int, LINE_SIZE> data_line, int address);
+ /**
+ * Helper for `read` a line
*/
void do_read(std::array<signed int, LINE_SIZE> &data_line, int address);
+ /**
+ * Helper for reading a word.
+ */
+ void do_read_word(signed int &data, int address);
};
std::ostream &operator<<(std::ostream &os, const Dram &d);