From db158de830e4fd4ab20ef5d357e24147c7a9281d Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 5 Mar 2025 14:17:45 -0500 Subject: constructors + method declarations for cache, dram, reponse, storage --- inc/cache.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 inc/cache.h (limited to 'inc/cache.h') diff --git a/inc/cache.h b/inc/cache.h new file mode 100644 index 0000000..e808727 --- /dev/null +++ b/inc/cache.h @@ -0,0 +1,25 @@ +#ifndef CACHE_H +#define CACHE_H +#include + +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 */ -- cgit v1.2.3