https://github.com/tsotimus/LRU-Cache-Simulator
A JavaScript simulation of hardware cache with k-way associativity and LRU replacement strategy
https://github.com/tsotimus/LRU-Cache-Simulator
cache calculator javascript js lru-cache simulation
Last synced: 10 months ago
JSON representation
A JavaScript simulation of hardware cache with k-way associativity and LRU replacement strategy
- Host: GitHub
- URL: https://github.com/tsotimus/LRU-Cache-Simulator
- Owner: tsotimus
- Created: 2020-04-13T02:16:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-05T23:19:05.000Z (about 6 years ago)
- Last Synced: 2025-03-21T15:07:13.113Z (over 1 year ago)
- Topics: cache, calculator, javascript, js, lru-cache, simulation
- Language: HTML
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LRU Cache Simulator
## How it works
The User inputs the cache description as well as the cache.
This page then uses JavaScript to Simulate the application of an LRU Cache.
For each memory access in the input, the page will print a 'C' if it is served by the cache, and print 'M' if it is served by the memory.
## How to use it.
The first line of the input is used to describe the cache. Using the Example A
- 32 = W
- 1024 = C
- 64 = B
- 4 = k
#### Definitions
- **W** is the number of bits in one word. This number will be a multiple of 8
- **C** is the number of data bytes in the cache. This number will be a power of 2. (In C, we do not count the space needed to store tags, just the space needed to store data.)
- **B** is the number of bytes in one cache block. This number will be a divisor of C.
- **k** is the number of lines in a block. This number will be a divisor of B.
#### Example A Input
32 1024 64 4
409
658
915
1172
661
1429
1168
403
925
1172
#### Example A Output
MMMM
CMCM
MC
**Load of the actual index.html for more detailed instructions.**
## Taks To Do
- [x] Fix Bug
- [ ] Finish CSS
- [ ] Finish Direct Mapping
- [x] Finish Fully Associative