diff options
author | bd <bdunaisky@umass.edu> | 2025-03-11 21:16:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-11 21:16:25 +0000 |
commit | f208e63ce553c6144a672cd35da23425fa7f86d1 (patch) | |
tree | 0574ee516499001244d33785a5fc380801c557c9 /inc/storage.h | |
parent | e24e3cd4d296599b9ef1b705846b1c868148b0fd (diff) | |
parent | d534555fbb9562a819d34ea874a711d737d051ae (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/storage.h')
-rw-r--r-- | inc/storage.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/inc/storage.h b/inc/storage.h index a30e74d..b54a6f7 100644 --- a/inc/storage.h +++ b/inc/storage.h @@ -14,24 +14,37 @@ class Storage virtual ~Storage() = default; /** - * Write `data` into `address`. + * Write `data` word into `address`. * @param the source making the request. * @param the data (hexadecimal) to write. * @param the address to write to. * @return a status code reflecting the state of the request. */ - virtual Response write(Accessor accessor, signed int data, int address) = 0; + virtual Response write_word(Accessor accessor, signed int data, int address) = 0; + + /** + * Write a data line to given address in this level of storage + */ + virtual Response write_line(Accessor accessor, std::array<signed int, LINE_SIZE> data_line, int address) = 0; + + /** - * Get the data at `address`. + * Get the data line at `address`. * @param the source making the request. * @param the address being accessed. * @return a status code reflecting the state of the request, and the * data being returned. */ - virtual Response read( + virtual Response read_line( Accessor accessor, int address, std::array<signed int, LINE_SIZE> &data) = 0; + + /** + * Read a word from given address in this level of storage + */ + virtual Response read_word(Accessor accessor, int address, signed int &data) = 0; + /** * Sidedoor view of `lines` of memory starting at `base`. * @param The base line to start getting memory from. |