Saturday, 24 November 2012
CS250 - 5.32pm
How to calculate length of virtual address:
123 KB = 10+7 = 17bits
8 KB = 19 bits
Virtual memory solves 2 problems:
- Space
Remaps virtual addresses to physical addresses.
32-bit 4GB, 4KN pages, each PTE is 4 bytes
=> 2^20 virtual pages
246 pages - 8 bits for VPN, 16 entry table, 4 for first level, 4 for second, 9 for offset.
3 second level tables, 1 first level table.
One of the keys is spatial locality.
Page table entries:
Levels of interaction
Problem: Runs very slowly.
Solution: Add a cache.
1. Virtual Addressed:
Virtual Address => D$ => virtual address => Translate => Physical address => L2
+ Fast
- Context Switches
- Other parts snoop physical address
- Synonyms
=> Good for speed, bad for functionality.
2. Physical Addressed:
Virtual address => Translate => Physical address => D$ => L2
+ Functionality
- Latently serialized.
3. Virtual Index/ Physical Tag
Tag. Index. Offset.
VPN. Page Offset.
Translation happens in parallel with data access.
TLB
Compare between L1, L2 (hardwar) and Mem (software): Block size,
miss latency, associativity
Why does miss latency drive the rest of the differences?
- Software is good at complicated things, hardware want simple FSMs.
#Do not understand any of this.
Castles in the Air 13:24 l
0 Coconut(s)