move microwatt mmu.bin test 3 page table to test pagetables module
[soc.git] / src / soc / experiment / test / pagetables.py
1 def b(x): # byte-reverse function
2 return int.from_bytes(x.to_bytes(8, byteorder='little'),
3 byteorder='big', signed=False)
4
5 test1 = {
6 0x10000: # PARTITION_TABLE_2
7 # PATB_GR=1 PRTB=0x1000 PRTS=0xb
8 b(0x800000000100000b),
9
10 0x30000: # RADIX_ROOT_PTE
11 # V = 1 L = 0 NLB = 0x400 NLS = 9
12 b(0x8000000000040009),
13
14 0x40000: # RADIX_SECOND_LEVEL
15 # V = 1 L = 1 SW = 0 RPN = 0
16 # R = 1 C = 1 ATT = 0 EAA 0x3
17 b(0xc000000000000183),
18
19 0x1000000: # PROCESS_TABLE_3
20 # RTS1 = 0x2 RPDB = 0x300 RTS2 = 0x5 RPDS = 13
21 b(0x40000000000300ad),
22
23 #0x10004: 0
24
25 }
26
27
28 # executable permission is barred here (EAA=0x2)
29 test2 = {
30 0x10000: # PARTITION_TABLE_2
31 # PATB_GR=1 PRTB=0x1000 PRTS=0xb
32 b(0x800000000100000b),
33
34 0x30000: # RADIX_ROOT_PTE
35 # V = 1 L = 0 NLB = 0x400 NLS = 9
36 b(0x8000000000040009),
37
38 0x40000: # RADIX_SECOND_LEVEL
39 # V = 1 L = 1 SW = 0 RPN = 0
40 # R = 1 C = 1 ATT = 0 EAA 0x2
41 b(0xc000000000000182),
42
43 0x1000000: # PROCESS_TABLE_3
44 # RTS1 = 0x2 RPDB = 0x300 RTS2 = 0x5 RPDS = 13
45 b(0x40000000000300ad),
46
47 #0x10004: 0
48
49 }
50
51
52 # microwatt mmu.bin first part of test 3. PRTBL must be set to 0x12000, PID to 1
53 microwatt_test3 = {
54 0x10000: 0x0930010000000080, # leaf node
55 0x12010: 0x0a00010000000000, # page table
56 0x8108: 0x0000000badc0ffee, # memory to be looked up
57 }
58