source: trunk/Softwares/Test/Test_010/src/sys/crt0.s @ 101

Last change on this file since 101 was 101, checked in by rosiere, 15 years ago

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1/*
2 * Test_010
3 *
4 * end_ko : infinite_loop
5 * end_ok : Write in R1 the stop address and stop an data
6 *          The store in the destination of an jump
7 * start  : Test l.addc
8 */
9       
10        .file   "crt0.s"
11        /*
12        .section .vector
13        */
14        .section .text
15        .align  4       
16
17/* ---[ 0x0  : Print a error ]------------------------------------------- */
18
19        .org 0x0
20_end_ko        :       
21        l.movhi r1,     hi(_tty)
22        l.ori   r1, r1, lo(_tty)
23        l.sw    4(r1), r1 /* stop address */
24_infinite_loop :       
25        l.j     _infinite_loop
26        l.nop
27
28_end_ok :
29        l.movhi r1,     hi(_tty)
30        l.ori   r1, r1, lo(_tty)
31        l.sw    4(r1), r0 /* stop address */
32
33
34/* ---[ 0x100: RESET exception ]----------------------------------------- */
35        .org 0x100
36        .global _start
37_start:
38        /*
39             A (r1)     B (r2)     - D (r3 wait)CY OV (SR = r6, mask SR = r5)
40                                       (r4)                (r7)
41          1) 0x00000000 0x00000000 - 0x00000000 0  0
42          2) 0x14011959 0x25071959 - 0x390832b2 0  0
43          3) 0xebfee6a7 0xdaf8e6a7 - 0xc6f7cd4e 1  0
44          4) 0xebfee6a7 0x25071959 - 0x11060001 1  0
45          5) 0x14011959 0xdaf8e6a7 - 0xeefa0001 0  0
46          6) 0x87654321 0xabcdef01 - 0x33333222 1  1
47          7) 0x789abcde 0x08765432 - 0x81111111 0  1
48          */
49
50        /* Mask to read OV (SR[11]), CY (SR[10]) and not F (SR[9]) */
51        l.movhi r5,     hi(0x00000c00)
52        l.ori   r5, r5, lo(0x00000c00)
53       
54        /**********/
55        /* Test 1 */
56        /**********/
57        l.movhi r1,     hi(0x00000000) /* RA */
58        l.ori   r1, r1, lo(0x00000000)
59        l.movhi r2,     hi(0x00000000) /* RB */
60        l.ori   r2, r2, lo(0x00000000)
61        l.movhi r3,     hi(0x00000000) /* RD wait */
62        l.ori   r3, r3, lo(0x00000000)
63        l.movhi r6,     hi(0x00000000) /* SR wait */
64        l.ori   r6, r6, lo(0x00000000)
65       
66        l.addc   r4, r1, r2
67
68        /* Test flag */
69        l.mfspr r7, r0, 17
70        l.and   r7, r7, r5
71
72        l.sfeq  r6, r7
73        l.bnf   _end_ko
74        l.nop
75
76        /* Test result */
77        l.sfeq  r3, r4
78        l.bnf   _end_ko
79        l.nop
80
81        /**********/
82        /* Test 2 */
83        /**********/
84        l.movhi r1,     hi(0x14011959) /* RA */
85        l.ori   r1, r1, lo(0x14011959)
86        l.movhi r2,     hi(0x25071959) /* RB */
87        l.ori   r2, r2, lo(0x25071959)
88        l.movhi r3,     hi(0x390832b2) /* RD wait */
89        l.ori   r3, r3, lo(0x390832b2)
90        l.movhi r6,     hi(0x00000000) /* SR wait */
91        l.ori   r6, r6, lo(0x00000000)
92       
93        l.addc   r4, r1, r2
94
95        /* Test flag */
96        l.mfspr r7, r0, 17
97        l.and   r7, r7, r5
98
99        l.sfeq  r6, r7
100        l.bnf   _end_ko
101        l.nop
102
103        /* Test result */
104        l.sfeq  r3, r4
105        l.bnf   _end_ko
106        l.nop
107
108        /**********/
109        /* Test 3 */
110        /**********/
111        l.movhi r1,     hi(0xebfee6a7) /* RA */
112        l.ori   r1, r1, lo(0xebfee6a7)
113        l.movhi r2,     hi(0xdaf8e6a7) /* RB */
114        l.ori   r2, r2, lo(0xdaf8e6a7)
115        l.movhi r3,     hi(0xc6f7cd4e) /* RD wait */
116        l.ori   r3, r3, lo(0xc6f7cd4e)
117        l.movhi r6,     hi(0x00000400) /* SR wait */
118        l.ori   r6, r6, lo(0x00000400)
119       
120        l.addc   r4, r1, r2
121
122        /* Test flag */
123        l.mfspr r7, r0, 17
124        l.and   r7, r7, r5
125
126        l.sfeq  r6, r7
127        l.bnf   _end_ko
128        l.nop
129
130        /* Test result */
131        l.sfeq  r3, r4
132        l.bnf   _end_ko
133        l.nop
134
135        /**********/
136        /* Test 4 */
137        /**********/
138        l.movhi r1,     hi(0xebfee6a7) /* RA */
139        l.ori   r1, r1, lo(0xebfee6a7)
140        l.movhi r2,     hi(0x25071959) /* RB */
141        l.ori   r2, r2, lo(0x25071959)
142        l.movhi r3,     hi(0x11060001) /* RD wait */
143        l.ori   r3, r3, lo(0x11060001)
144        l.movhi r6,     hi(0x00000400) /* SR wait */
145        l.ori   r6, r6, lo(0x00000400)
146       
147        l.addc   r4, r1, r2
148
149        /* Test flag */
150        l.mfspr r7, r0, 17
151        l.and   r7, r7, r5
152
153        l.sfeq  r6, r7
154        l.bnf   _end_ko
155        l.nop
156
157        /* Test result */
158        l.sfeq  r3, r4
159        l.bnf   _end_ko
160        l.nop
161
162        /**********/
163        /* Test 5 */
164        /**********/
165        l.movhi r1,     hi(0x14011959) /* RA */
166        l.ori   r1, r1, lo(0x14011959)
167        l.movhi r2,     hi(0xdaf8e6a7) /* RB */
168        l.ori   r2, r2, lo(0xdaf8e6a7)
169        l.movhi r3,     hi(0xeefa0001) /* RD wait */
170        l.ori   r3, r3, lo(0xeefa0001)
171        l.movhi r6,     hi(0x00000000) /* SR wait */
172        l.ori   r6, r6, lo(0x00000000)
173       
174        l.addc   r4, r1, r2
175
176        /* Test flag */
177        l.mfspr r7, r0, 17
178        l.and   r7, r7, r5
179
180        l.sfeq  r6, r7
181        l.bnf   _end_ko
182        l.nop
183
184        /* Test result */
185        l.sfeq  r3, r4
186        l.bnf   _end_ko
187        l.nop
188
189        /**********/
190        /* Test 6 */
191        /**********/
192        l.movhi r1,     hi(0x87654321) /* RA */
193        l.ori   r1, r1, lo(0x87654321)
194        l.movhi r2,     hi(0xabcdef01) /* RB */
195        l.ori   r2, r2, lo(0xabcdef01)
196        l.movhi r3,     hi(0x33333222) /* RD wait */
197        l.ori   r3, r3, lo(0x33333222)
198        l.movhi r6,     hi(0x00000c00) /* SR wait */
199        l.ori   r6, r6, lo(0x00000c00)
200       
201        l.addc   r4, r1, r2
202
203        /* Test flag */
204        l.mfspr r7, r0, 17
205        l.and   r7, r7, r5
206
207        l.sfeq  r6, r7
208        l.bnf   _end_ko
209        l.nop
210
211        /* Test result */
212        l.sfeq  r3, r4
213        l.bnf   _end_ko
214        l.nop
215
216        /**********/
217        /* Test 7 */
218        /**********/
219        l.movhi r1,     hi(0x789abcde) /* RA */
220        l.ori   r1, r1, lo(0x789abcde)
221        l.movhi r2,     hi(0x08765432) /* RB */
222        l.ori   r2, r2, lo(0x08765432)
223        l.movhi r3,     hi(0x81111111) /* RD wait */
224        l.ori   r3, r3, lo(0x81111111)
225        l.movhi r6,     hi(0x00000800) /* SR wait */
226        l.ori   r6, r6, lo(0x00000800)
227       
228        l.addc   r4, r1, r2
229
230        /* Test flag */
231        l.mfspr r7, r0, 17
232        l.and   r7, r7, r5
233
234        l.sfeq  r6, r7
235        l.bnf   _end_ko
236        l.nop
237
238        /* Test result */
239        l.sfeq  r3, r4
240        l.bnf   _end_ko
241        l.nop
242       
243        /**********/
244        /* End */
245        /**********/
246
247        l.j     _end_ok
248        l.nop
Note: See TracBrowser for help on using the repository browser.