04. Cache
MARS
- «Tools → Data Cache Simulator»
- «Tools → Memory Reference Visualization»
- Try 2×3=6 examples
- Direct Mapping / Fully Associative / 2-Way associative
- Cache drop: LRU / Random
Examples:
- Linear:
- Gapped
- Equidistance (try to vary step):
Task: write a program, that:
- burns out default fully associative cache with 100% misses
- +does this in cycle (if previously not)
- +fills only 256 bytes of memory without a gap
H/W
(can be done in class if time allows)
Write a program that utilizes memory sparsely, so it's footprint 100% misses 2-way associative MARS cache simulator, but (almost) fits into 4-way associative cache with 16 lines (blocks) of cache
Make it available at sugon server in the subdirectory asm:
1 localhost$ ssh sugon -p 2131 2 ... 3 [your_login@sugon ~]$ mkdir src 4 [your_login@sugon ~]$ ls -a src 5 . .. 6 [your_login@sugon ~]$ exit 7 ... 8 localhost$ scp -P 2131 progCache.asm your_login@sugon:src/ 9 progCache.asm 100% 285 26.7KB/s 00:00 10 localhost$ ssh sugon -p 2131 11 ... 12 [your_login@sugon ~]$ mkdir src 13 [your_login@sugon ~]$ ls -a src 14 . .. progCache.asm 15