diff options
author | bd <bdunahu@operationnull.com> | 2025-03-09 20:15:45 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-09 20:15:45 -0400 |
commit | 9bd18b0499d5096bc91b09a2d26e700ca1560de4 (patch) | |
tree | 196b3ac11d3648e29d67fb261ed0f78720719b94 /inc | |
parent | 5cf5ebce233cc49cc04ac8c7713e12e87bab7798 (diff) |
Untested implementation for loading absent data into cache
Diffstat (limited to 'inc')
-rw-r--r-- | inc/cache.h | 12 | ||||
-rw-r--r-- | inc/storage.h | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/inc/cache.h b/inc/cache.h index a317f5d..c8c9736 100644 --- a/inc/cache.h +++ b/inc/cache.h @@ -30,17 +30,17 @@ class Cache : public Storage /** * Fetches `address` from a lower level of storage if it is not already * present. If it is not, temporarily sets the is_blocked attribute of this - * cache level to true. + * cache level to true, and the victim line is chosen/written back. * @param the address that must be present in cache. */ void fetch_resource(int address); /** - * 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. + * An array of metadata about elements in `data`. + * If the first value of an element is negative, the corresponding + * element in `data` is invalid. If the most second value of an element + * is nonzero, the corresponding element in `data` is dirty. */ - std::array<std::bitset<2>, L1_CACHE_SIZE> stat; + std::array<std::array<int, 2>, L1_CACHE_SIZE> meta; }; #endif /* CACHE_H_INCLUDED */ diff --git a/inc/storage.h b/inc/storage.h index 9707041..793b982 100644 --- a/inc/storage.h +++ b/inc/storage.h @@ -73,10 +73,10 @@ class Storage */ int wait_time; /** - * A flag indicating whether this level of storage is currently blocked by a - * lower level. + * A flag indicating whether this level of storage is currently waiting for + * a lower level. */ - int is_blocked; + int is_waiting; }; #endif /* STORAGE_H_INCLUDED */ |