summaryrefslogtreecommitdiff
path: root/inc/cache.h
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-11 11:28:25 -0400
committerGitHub <noreply@github.com>2025-03-11 11:28:25 -0400
commite24e3cd4d296599b9ef1b705846b1c868148b0fd (patch)
tree25646d98b4bfcf4b9a664eabfc2651c481984c1d /inc/cache.h
parent357e7fb37caf58cdfcdf85f7553db9378ff16e0c (diff)
parentfde996690d77b81e445450671a0723f837de4eb3 (diff)
Merge pull request #23 from bdunahu/bdunahu
Memory simulator CLI function implementation
Diffstat (limited to 'inc/cache.h')
-rw-r--r--inc/cache.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/inc/cache.h b/inc/cache.h
index e8b7030..04f6181 100644
--- a/inc/cache.h
+++ b/inc/cache.h
@@ -3,6 +3,7 @@
#include "definitions.h"
#include "storage.h"
#include <array>
+#include <ostream>
class Cache : public Storage
{
@@ -25,6 +26,13 @@ class Cache : public Storage
int address,
std::array<signed int, LINE_SIZE> &data) override;
+ /**
+ * Getter for the meta attribute.
+ * TODO this doesn't seem like good object-oriented practice.
+ * @return this->meta
+ */
+ std::array<std::array<int, 2>, L1_CACHE_SIZE> get_meta() const;
+
private:
/**
* Fetches `address` from a lower level of storage if it is not already
@@ -42,4 +50,6 @@ class Cache : public Storage
std::array<std::array<int, 2>, L1_CACHE_SIZE> meta;
};
+std::ostream &operator<<(std::ostream &os, const Cache &c);
+
#endif /* CACHE_H_INCLUDED */