-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.test-script
executable file
·95 lines (78 loc) · 1.52 KB
/
.test-script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/expect
set timeout 15
spawn term/term.py -t 127.0.0.1:6666
expect "MONITOR for LA32R - initialized." {} timeout {exit 1}
expect ">>"
send "R\n"
expect ">>"
send "R\n"
expect ">>"
send "A\n"
send "80100000\n"
expect "one instruction per line"
expect "]"
send "addi.w \$r12,\$r0,1\n"
expect "]"
send "add.w \$r13,\$r12,\$r12\n"
expect "]"
send "jr \$r1\n"
expect "]"
send "\n"
expect ">>"
send "D\n"
send "80100000\n"
send "16\n"
expect -re "0x80100000: +0x0280040c" {} timeout {exit 1}
expect ">>"
send "U\n"
send "80100000\n"
send "16\n"
expect ">>"
send "G\n"
send "80100000\n"
expect "elapsed time" {} timeout {exit 1}
expect ">>"
send "R\n"
expect -re "t1.+0x00000002" {} timeout {exit 1}
# TLB required
expect ">>"
send "G\n"
send "0\n"
expect "elapsed time" {} timeout {exit 1}
expect ">>"
send "T\n"
send " -1\n"
expect -re "00000_000 +00100_000 +1 +1 +1 +1" {} timeout {exit 1}
expect ">>"
send "D\n"
send "0\n"
send "16\n"
expect -re "0x00000000: +0x0280040c" {} timeout {exit 1}
# Test user stack access
expect ">>"
send "A\n"
send "80100000\n"
expect "one instruction per line"
expect "]"
send "addi.w \$r12,\$r0,1\n"
expect "]"
send "st.w \$r12,\$r3,-4\n"
expect "]"
send "ld.w \$r13,\$r3,-4\n"
expect "]"
send "jr \$r1\n"
expect "]"
send "\n"
expect ">>"
send "G\n"
send "0\n"
expect "elapsed time" {} timeout {exit 1}
expect ">>"
send "T\n"
send " -1\n"
expect -re "7ffff_000 +007ef_000 +1 +1 +1 +1" {} timeout {exit 1}
expect ">>"
send "R\n"
expect -re "t1.+0x00000001" {} timeout {exit 1}
expect ">>"
send "Q\n"