diff options
author | bd <bdunahu@operationnull.com> | 2025-04-16 14:45:07 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-16 14:45:07 -0400 |
commit | 7a94defa477d5dd0a5f7c77a7c64d46aa4266e6a (patch) | |
tree | fd4cd663921e0b912855eb3272397e5abe1ff50d /inc | |
parent | 71f69927931e007d0bac13b9268b6a697b45c70a (diff) |
Add untested support for configurable ways
Diffstat (limited to 'inc')
-rw-r--r-- | inc/cache.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/inc/cache.h b/inc/cache.h index 6f06466..4b2521a 100644 --- a/inc/cache.h +++ b/inc/cache.h @@ -55,7 +55,31 @@ nn * Constructor. * @param the address that must be present in cache. * @param 0 if the address is currently in cache, 1 if it is being fetched. */ - int is_address_missing(int address); + int priming_address(int address); + /** + * Walks the ways in this set of ways. If none of the tags match, returns -1. Otherwise, returns + * the index the matching data is located. + * @param an index aligned to the set of ways in `this->data' + * @param the tag to be matched + * @return -1 if the tag is not present in this set of ways (not in cache), or the true index if + * the tag is present. + */ + unsigned int is_address_missing(unsigned int true_index, unsigned int tag); + /** + * Converts an index into a set of ways into an index into `this->data', which is a + * 1D array. The next `this->ways' entries after the returned index represent the ways in the + * set for this index. + * @param an index to a set of ways + * @param an index aligned to the set of ways in `this->data' + */ + unsigned int get_true_index(unsigned int index); + /** + * Selects an index into the `data' and `meta' tables for write back using a random replacement + * policy. + * @param an index aligned to the set of ways in `this->data' + * @return an index aligned to the data line selected for eviction + */ + unsigned int get_replacement_index(unsigned int index); /** * The number of bits required to specify a line in this level of cache. */ |