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 | d7d24031e6df2529ba5c447da0393807be3e3e81 (patch) | |
tree | ba813d226ae916abfef2502d3746f8fa3fbc40dc /inc/dram.h | |
parent | 7284cc1391dbb250cd6738a75853be7e3576fa41 (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); |