diff options
author | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-03-11 11:18:01 -0400 |
---|---|---|
committer | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-03-11 11:34:13 -0400 |
commit | 93b010dbbcdc921bfccae673918eb9fbf354538a (patch) | |
tree | ba813d226ae916abfef2502d3746f8fa3fbc40dc /inc/dram.h | |
parent | 1e1279817e8a2a03b8c1acb9425464c82a065e01 (diff) |
support for reading word, writing line to storage, dirty cache eviction, cache load
Diffstat (limited to 'inc/dram.h')
-rw-r--r-- | inc/dram.h | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -22,18 +22,29 @@ class Dram : public Storage Accessor accessor, int address, std::array<signed int, LINE_SIZE> &data) override; + Response write_line(Accessor accessor, std::array<signed int, LINE_SIZE> data_line, int address) override; - void write_line(std::array<signed int, LINE_SIZE> data_line, int address); + Response read(Accessor accessor, int address, std::array<signed int, LINE_SIZE>& data) 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); + 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); |