diff options
author | bd <bdunahu@operationnull.com> | 2025-03-09 12:05:12 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-09 12:05:12 -0400 |
commit | 0b1b537697185613a2da8d5ed374f8f1e1ea9ffe (patch) | |
tree | a5dd7456fe035bad6c310215d4f6076ff92f90c6 /inc | |
parent | 87bc2a9e172a0f693184c85f0d9661d47c99cd7e (diff) |
Add bitset field to cache.h for keeping track of write/validity
Diffstat (limited to 'inc')
-rw-r--r-- | inc/cache.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/inc/cache.h b/inc/cache.h index f1fb942..0c86e97 100644 --- a/inc/cache.h +++ b/inc/cache.h @@ -1,6 +1,9 @@ #ifndef CACHE_H #define CACHE_H -#include <storage.h> +#include "definitions.h" +#include "storage.h" +#include <array> +#include <bitset> class Cache : public Storage { @@ -19,6 +22,15 @@ class Cache : public Storage Response write(Accessor accessor, signed int data, int address) override; Response read(Accessor accessor, int address) override; + + private: + /** + * An array of paired bits. + * If the least significant bit of an element is set, the corresponding + * element in `data` is invalid. If the most significant bit of an element + * is set, the corresponding element in `data` is dirty. + */ + std::array<std::bitset<2>, L1_CACHE_SIZE> stat; }; #endif /* CACHE_H_INCLUDED */ |