20. Exception Handler
Exception type Vector offect[11:0] Example
Reset 0x100 Caused by Software or
Hardware reset
Bus error 0x200
Data Page fault 0x300
Instruction Page fault 0x400
Tick Timer 0x500 Timer interrupt
Alignment 0x600
Illegal Instruction 0x700
External interrupt 0x800 External interrupt asserted
D-TLB miss 0x900 No matching entry in DTLB
I-TLB miss 0xA00 No matching entry in ITLB
Range 0xB00
System call 0xC00
Float Point 0xD00
Trap 0xE00
33. D-cache 8k 512Line 4word
PPN[31:13] 0x1[12:4] 0x8[3:0]
Physical [31:13]
Physical [31:13]
Physical [31:13]
Physical [31:13]
WORD
WORD
WORD
WORD
WORD
Physical [31:13] V
V
V
V
V
WORD
WORD
WORD
WORD 0
1
2
3
4
5
6
7
2047
0
1
2
3
511
13:212:4
34. Task address space isolation
Allow safe sharing of memory among multiple tasks
Why OS need MMU Support?
CPU
Task1
Task2
Virtual
Task 1
Task2
Memory
Physical
35. Page Index Level 1[31:24] Page Offset[12:0]Page Index Level 2[23:13]
0
255
PTE
PTE2
+
0
2047
Physical Page Number Page Offset[12:0]
+
Address
36. Page Table entry
Physical Page Number D A WBC CI CCWOMWRWRREV
Entry Store in Memory
Set in Data Translation Lookaside Buffer Translate Registers when
DTLB-MISS
39. DTLB Architecture
Virtial address[19:31] Index[13:18] Offset[12:0]
VPN [19:31] V
VPN [19:31] V
VPN [19:31] V
VPN [19:31] V
PPN [13:31]
PPN [13:31]
PPN[13:31]
PPN [13:31]
PPN [13:31]VPN [19:31] V
Direct mapped
相等
&& V=1
Physical address[13:31] Offset
DTLB miss
DTLB Match Register
DTLB Translate Regidter
EEAR:0x6000
W R W R CI
W R W R CI
W R W R CI
W R W R CI
W R W R CI
Super User
W R W R CI
45. SPM data moving interrupt handler
Free SPM
space?
Interrupt
Select a victim page and
move it to Data ram
Move the page into SPM
No
Yes
Update D-TLB
Translate Regidter
Update Page table