From 0041cc424b5711559302bd77a534922a9dbca8ae Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 16 Apr 2025 15:06:04 -0400 Subject: Use signed integers for cache eviction --- inc/cache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/cache.h') diff --git a/inc/cache.h b/inc/cache.h index 4b2521a..8075d1a 100644 --- a/inc/cache.h +++ b/inc/cache.h @@ -64,7 +64,7 @@ nn * Constructor. * @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); + int is_address_missing(int true_index, 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 @@ -72,14 +72,14 @@ nn * Constructor. * @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); + int get_true_index(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); + int get_replacement_index(int index); /** * The number of bits required to specify a line in this level of cache. */ -- cgit v1.2.3