diff options
author | bd <bdunaisky@umass.edu> | 2025-03-06 21:28:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-06 21:28:20 +0000 |
commit | 0983f834b66f046c5468814fa86af3f4a3c215b6 (patch) | |
tree | af137790ab40290d1cc4e83f3261370c591512bc /inc/cache.h | |
parent | e3369aad54bce775e2951e71618eb2cbb17972f9 (diff) | |
parent | e296a3a6ab782cb80b7091324b41bb78db6d3906 (diff) |
Merge pull request #13 from bdunahu/bdunahu
constructors + method declarations for cache, dram, reponse, storage
Diffstat (limited to 'inc/cache.h')
-rw-r--r-- | inc/cache.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/inc/cache.h b/inc/cache.h new file mode 100644 index 0000000..101cd6e --- /dev/null +++ b/inc/cache.h @@ -0,0 +1,25 @@ +#ifndef CACHE_H +#define CACHE_H +#include <storage.h> + +class Cache : public Storage +{ + public: + /** + * Constructor. + * @param The number of `lines` contained in memory. The total number of + * words is this number multiplied by 4. + * @param The next lowest level in storage. Methods from this object are + * called in case of a cache miss. + * @param The number of clock cycles each access takes. + * @return A new cache object. + */ + Cache(int lines, Storage *lower, int delay); + ~Cache(); + + Response *write(Accessor accessor, signed int data, int address) override; + Response *read(Accessor accessor, int address) override; + int **view(int base, int lines) override; +}; + +#endif /* CACHE_H_INCLUDED */ |