5. (20pts) Multi-Level Pagetables and TLB miss cost 3 of Assume the following TL
ID: 3722774 • Letter: 5
Question
5. (20pts) Multi-Level Pagetables and TLB miss cost 3 of Assume the following TLB and a 2-level page table with each page size 256 bytes. Assume 16-bit address space. And assume ASID of current process if 122. ASID 122 122 122 121 VPN 0xbb Oxf 0x05 0x06 PFN 0x91 0x23 0x91 0x12 Valid 0 0 How many physical accesses for each instruction for each of the following instruction? Justify your answers. (a) 0xbb 10: movl 0x05 1 1 , %edi (b) 0xff10: movl 0x0611, %edi (c) 0x0613: addl $0x3, %edi (d) 0xff13: addl $0x3, %edi (e) 0x0519: movl %edi, 0xFF10Explanation / Answer
Answer:
For a TLB hit, both Page Number(VPN) and ASID must match.
In case of TLB hit, we need only one physical access with physical frame number(PFN) available in the TLB.
In case of TLB miss we need 3 physical access as follows:
1. one physical access for acessing the first level page table
2. one physical access for accessing the second level page table
3. one physical accss from the main memory
Answer to (a):
Address of instruction is 0xbb10 i.e. VPN=0xbb
So there is TLB hit. (VPN=0xbb and ASID=122 and Valid=1)
So, number of physical access = 1 for instruction fetch
Now to execute the instruction it access 0x0511 i.e. VPN = 0x05
So, execution also has TLB hit (VPN=0x05 and ASID=122 and Valid=1)
So, number of physical access = 1 for instruction execution
Therefore, total physical access = 2
Answer to (b):
Address of instruction is 0xff10 i.e. VPN=0xff
So there is TLB miss. (VPN=0xff and ASID=122 and Valid=0) since there is invalid entry in TLB.
So, number of physical access = 3 for instruction fetch
Now to execute the instruction it access 0x0611 i.e. VPN = 0x06
So, execution also has TLB miss (VPN=0x06 and ASID=121 and Valid=0) since there is invalid entry in TLB.
So, number of physical access = 3 for instruction execution
Therefore, total physical access = 6
Answer to (c):
Address of instruction is 0x0613 i.e. VPN=0x06
So there is TLB miss. (VPN=0x06 and ASID=121 and Valid=0)
So, number of physical access = 3 for instruction fetch
Now to execute the instruction it does not access memory.
Therefore, total physical access = 3
Answer to (d):
Address of instruction is 0xff13 i.e. VPN=0xbb
So there is TLB miss. (VPN=0xff and ASID=122 and Valid=0)
So, number of physical access = 3 for instruction fetch
Now to execute the instruction it does not access memory.
Therefore, total physical access = 3
Answer to (e):
Address of instruction is 0x0519 i.e. VPN=0x05
So there is TLB hit. (VPN=0x05 and ASID=122 and Valid=1)
So, number of physical access = 1 for instruction fetch
Now to execute the instruction it access 0xff10 i.e. VPN = 0xff
So, execution also has TLB miss (VPN=0xff and ASID=122 and Valid=0) since there is invalid entry in TLB.
So, number of physical access = 3 for instruction execution
Therefore, total physical access = 4
NB: Hope it helps. Let me know any concern.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.