A desktop application built with Python and Tkinter that emulates different cache memory configurations, mapping techniques, and replacement/write policies.
This project simulates the behavior of various cache memory architectures and policies to help understand their impact on memory access performance.
The simulator supports:
- Direct-mapped cache
- Fully associative cache
- Set-associative cache (configurable ways)
- Replacement policies: Least Recently Used (LRU), First-In-First-Out (FIFO), and Random
- Write policies: Write-Back and Write-Through
- Performance metrics: Cache hit/miss rate
- Desktop GUI using Tkinter
- Custom cache configuration (size, block size, mapping type, policies)
- Dynamic visualization of cache and main memory state
- Read and write operations with real-time cache updates
- Statistics tracking for hits and misses
- Displays tag, valid and dirty bits for each cache line
- Python 3.10+
- Tkinter (GUI)
- Object-Oriented Programming
- Simulation algorithms for cache mapping and replacement
- Data structures: lists, sets, dictionaries
cache/β core cache functionality (Cache,Line,MainMemory)mappings/β implementations for direct, set-associative, and fully associative mappingreplacement_policies/β strategy modules: LRU, FIFO, Randomwrite_policies/β logic for Write-Back and Write-Throughgui/β Tkinter-based interface (SimulatorFrame)utils/β helpers for formatting, performance calculation
The application provides:
- A configuration panel for:
- Cache type selection
- Block/cache size
- Replacement and write policies
- Buttons to start simulation, read data, write data
- Live view of memory blocks and cache lines
- Dashboard showing hit/miss stats
- Hit Rate: Percentage of memory accesses served from cache
- Miss Rate: Percentage of memory accesses served from main memory
- Live counters updated during each operation
- Add support for trace file imports
- Enable cache flush and reset operations
- Export stats to CSV or Excel
- Add animations for memory block movement
- Improve layout and styling with custom themes
- GeeksForGeeks β Cache Mapping Techniques
- Wikipedia β Cache Memory
- TechTarget β Cache Memory
- Javatpoint β Cache Memory
- Medium β Cache Simulator
- Redis Glossary β Cache Memory
- YouTube β Python Cache Simulator
- UW CSE β Cache Simulator