Skip to content

[Feature]: Cache Simulator #59

@prajwal3114

Description

@prajwal3114

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions