diff --git a/cache.c b/cache.c index c8877fa..fa725be 100644 --- a/cache.c +++ b/cache.c @@ -74,12 +74,12 @@ int cread(unsigned int cmf, unsigned int* hex_addr, bool* hit, bool* replace) { if (cache[line]->tag == tag) { // hit - *hit = true; + *replace = true; cache[line]->hit_count++; ret_val = cache[line]->block[block_offset]; } else { // miss - *replace = true; + *hit = true; cache[line]->tag = tag; cache[line]->hit_count = 1;