Skip to content

Instantly share code, notes, and snippets.

@Aadarsh-aadi
Aadarsh-aadi / Cache Simulator
Created April 11, 2023 16:49 — forked from markjgap/Cache Simulator
Written in C, program simulates cache logic with a write-back and LRU policy. Handles direct-mapped, set-associative and full-associative caches.
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <unistd.h>
#include <math.h> // used to help calculate set and block
#include "cachelab.h"
/*
* Simulates a cache logic with a write-back and LRU (least recently used) policy.
* Handles direct-mapped, set-associative and full-associative caches.