generated from OPCODE-Open-Spring-Fest/template
-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
Description
So, what is it about?
🧠 Overview
This project is a C++ Cache Memory Simulator that emulates how a CPU cache interacts with main memory.
It supports multiple cache replacement policies and tracks cache hits, misses, and overall efficiency.
This simulation helps understand Operating System and Computer Architecture concepts such as:
- Memory hierarchy
- Temporal and spatial locality
- Page and block replacement algorithms
🚀 Features
✅ Implements major cache replacement strategies:
- FIFO (First-In First-Out)
- LRU (Least Recently Used)
- LFU (Least Frequently Used)
- (Optional) Optimal (Belady’s Algorithm) for theoretical comparison
✅ Supports:
- Custom cache size and block size
- Variable access sequences
- Display of current cache state after each access
- Hit/Miss statistics
- Average memory access time (AMAT) calculation
✅ Well-structured using OOP principles:
class CacheBlock;
class Cache;
class ReplacementPolicy; // Abstract base class
class FIFOReplacement : public ReplacementPolicy;
class LRUReplacement : public ReplacementPolicy;
class LFUReplacement : public ReplacementPolicy;
class CacheSimulator;
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct