Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

CPU and Cache Simulator

This project is a C++ simulator that shows how a CPU scheduler runs tasks and how memory blocks move through different cache levels in real time.

What is in the Project

  • Task Scheduler: Controls which task gets CPU time next.
  • 3-Level Cache Hierarchy: Simulates L1, L2, and L3 memory storage to make memory hits, misses, and evictions visible.
  • Terminal Display: Prints out the exact state of the cache levels at every single cycle.

My Approach

  1. Scheduling: I used the Round Robin algorithm with a time quantum of 3. This means each task gets a fair turn of up to 3 cycles before moving to the back of the line so other tasks can run.
  2. Cache Memory: I built a 3-level cache setup (L1, L2, L3) followed by RAM. When a task requests a memory block, it searches from L1 down to RAM.
  3. Eviction: If a cache level is completely full and needs to store a new block, it uses the FIFO (First-In, First-Out) rule, which means the oldest memory block in that queue gets kicked out.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages