This Python-based Multilevel Cache Simulator models a two-level cache system (L1 & L2), allowing users to specify cache parameters such as size, block size, associativity, and replacement policies (LRU, FIFO, or Random).
The simulator processes memory accesses in a multithreaded environment, mimicking multiple CPU cores accessing the cache in parallel. It logs the results and visualizes cache performance with a bar chart.
- Multilevel Cache (L1 & L2) β Simulates two levels of cache to improve memory access efficiency.
- Configurable Replacement Policies β Supports:
- LRU (Least Recently Used)
- FIFO (First-In-First-Out)
- Random replacement strategies
- Associative Mapping β Allows both:
- Direct Mapping (1-way)
- N-Way Set Associative Mapping based on user input
- Parallel Processing (Multithreading) β Simulates multiple CPUs accessing the cache simultaneously.
- Performance Logging & Visualization β
- Saves results to a text file (results.txt).
- Generates a bar chart (cache_performance.png) for analysis.