OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_1_x/] [or1ksim/] [testbench/] [except.S] - Blame information for rev 600

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 342 markom
/* Support file for c based tests */
2 410 simons
#include "spr_defs.h"
3 342 markom
 
4 441 simons
#define reset _reset
5
 
6 410 simons
        .section .stack
7
        .space 0x1000
8
_stack:
9
 
10 342 markom
        .section .except
11
        .extern _reset_support
12
        .extern _c_reset
13
        .extern _excpt_buserr
14
        .extern _excpt_dpfault
15
        .extern _excpt_ipfault
16 600 simons
        .extern _excpt_tick
17 342 markom
        .extern _excpt_align
18
        .extern _excpt_illinsn
19 600 simons
        .extern _excpt_int
20 342 markom
        .extern _excpt_dtlbmiss
21
        .extern _excpt_itlbmiss
22
        .extern _excpt_range
23
        .extern _excpt_syscall
24
        .extern _excpt_break
25
        .extern _excpt_trap
26
 
27
 
28
        .org    0x100
29
_reset_vector:
30
        l.nop
31
        l.nop
32 436 simons
        l.addi  r2,r0,0x0
33
        l.addi  r3,r0,0x0
34
        l.addi  r4,r0,0x0
35
        l.addi  r5,r0,0x0
36
        l.addi  r6,r0,0x0
37
        l.addi  r7,r0,0x0
38
        l.addi  r8,r0,0x0
39
        l.addi  r9,r0,0x0
40
        l.addi  r10,r0,0x0
41
        l.addi  r11,r0,0x0
42
        l.addi  r12,r0,0x0
43
        l.addi  r13,r0,0x0
44
        l.addi  r14,r0,0x0
45
        l.addi  r15,r0,0x0
46
        l.addi  r16,r0,0x0
47
        l.addi  r17,r0,0x0
48
        l.addi  r18,r0,0x0
49
        l.addi  r19,r0,0x0
50
        l.addi  r20,r0,0x0
51
        l.addi  r21,r0,0x0
52
        l.addi  r22,r0,0x0
53
        l.addi  r23,r0,0x0
54
        l.addi  r24,r0,0x0
55
        l.addi  r25,r0,0x0
56
        l.addi  r26,r0,0x0
57
        l.addi  r27,r0,0x0
58
        l.addi  r28,r0,0x0
59
        l.addi  r29,r0,0x0
60
        l.addi  r30,r0,0x0
61
        l.addi  r31,r0,0x0
62
 
63 410 simons
        l.movhi r1,hi(_stack)
64
        l.ori   r1,r1,lo(_stack)
65
 
66 436 simons
        /* Check if this is RTL version */
67
        l.lbz   r3,0(r0)
68
        l.sfeqi r3,0xff
69
        l.bf    2f
70
        l.nop
71 410 simons
        l.movhi r3,hi(_src_beg)
72
        l.ori   r3,r3,lo(_src_beg)
73
        l.movhi r4,hi(_dst_beg)
74
        l.ori   r4,r4,lo(_dst_beg)
75
        l.movhi r5,hi(_dst_end)
76
        l.ori   r5,r5,lo(_dst_end)
77
        l.sub   r5,r5,r4
78
        l.sfeqi r5,0
79
        l.bf    2f
80 342 markom
        l.nop
81 410 simons
1:      l.lwz   r6,0(r3)
82
        l.sw    0(r4),r6
83
        l.addi  r3,r3,4
84
        l.addi  r4,r4,4
85
        l.addi  r5,r5,-4
86
        l.sfgtsi r5,0
87
        l.bf    1b
88
        l.nop
89 342 markom
 
90 410 simons
2:
91
 
92 441 simons
        l.movhi r2,hi(reset)
93
        l.ori   r2,r2,lo(reset)
94 410 simons
        l.jr    r2
95
        l.nop
96
 
97 342 markom
        .org    0x200
98
_buserr_vector:
99
        l.addi  r1,r1,-116
100
        l.sw    0x18(r1),r9
101
        l.jal   store_regs
102
        l.nop
103
        l.movhi r9,hi(end_except)
104 410 simons
        l.ori   r9,r9,lo(end_except)
105 409 markom
        l.movhi r10,hi(_excpt_buserr)
106
        l.ori   r10,r10,lo(_excpt_buserr)
107
        l.lwz   r10,0x0(r10)
108 342 markom
        l.jr    r10
109
        l.nop
110
 
111
        .org    0x300
112
_dpfault_vector:
113
        l.addi  r1,r1,-116
114
        l.sw    0x18(r1),r9
115
        l.jal   store_regs
116
        l.nop
117 461 simons
/*
118 436 simons
        l.mfspr r3,r0,SPR_EPCR_BASE
119
        l.addi  r3,r3,-4
120
        l.mtspr r0,r3,SPR_EPCR_BASE
121 461 simons
*/
122 342 markom
        l.movhi r9,hi(end_except)
123 410 simons
        l.ori   r9,r9,lo(end_except)
124 409 markom
        l.movhi r10,hi(_excpt_dpfault)
125
        l.ori   r10,r10,lo(_excpt_dpfault)
126
        l.lwz   r10,0(r10)
127 342 markom
        l.jr    r10
128
        l.nop
129
 
130
        .org    0x400
131
_ipfault_vector:
132
        l.addi  r1,r1,-116
133
        l.sw    0x18(r1),r9
134
        l.jal   store_regs
135
        l.nop
136
        l.movhi r9,hi(end_except)
137 410 simons
        l.ori   r9,r9,lo(end_except)
138 409 markom
        l.movhi r10,hi(_excpt_ipfault)
139
        l.ori   r10,r10,lo(_excpt_ipfault)
140
        l.lwz   r10,0(r10)
141 342 markom
        l.jr    r10
142
        l.nop
143
 
144
        .org    0x500
145
_lpint_vector:
146
        l.addi  r1,r1,-116
147
        l.sw    0x18(r1),r9
148
        l.jal   store_regs
149
        l.nop
150
        l.movhi r9,hi(end_except)
151 409 markom
        l.ori   r9,r9,lo(end_except)
152 600 simons
        l.movhi r10,hi(_excpt_tick)
153
        l.ori   r10,r10,lo(_excpt_tick)
154 409 markom
        l.lwz   r10,0(r10)
155 342 markom
        l.jr    r10
156
        l.nop
157
 
158
        .org    0x600
159
_align_vector:
160
        l.addi  r1,r1,-116
161
        l.sw    0x18(r1),r9
162
        l.jal   store_regs
163
        l.nop
164
        l.movhi r9,hi(end_except)
165 409 markom
        l.ori   r9,r9,lo(end_except)
166
        l.movhi r10,hi(_excpt_align)
167
        l.ori   r10,r10,lo(_excpt_align)
168
        l.lwz   r10,0(r10)
169 342 markom
        l.jr    r10
170
        l.nop
171
 
172
        .org    0x700
173
_illinsn_vector:
174
        l.addi  r1,r1,-116
175
        l.sw    0x18(r1),r9
176
        l.jal   store_regs
177
        l.nop
178
        l.movhi r9,hi(end_except)
179 409 markom
        l.ori   r9,r9,lo(end_except)
180
        l.movhi r10,hi(_excpt_illinsn)
181
        l.ori   r10,r10,lo(_excpt_illinsn)
182
        l.lwz   r10,0(r10)
183 342 markom
        l.jr    r10
184
        l.nop
185
 
186
        .org    0x800
187
_hpint_vector:
188
        l.addi  r1,r1,-116
189
        l.sw    0x18(r1),r9
190
        l.jal   store_regs
191
        l.nop
192
        l.movhi r9,hi(end_except)
193 409 markom
        l.ori   r9,r9,lo(end_except)
194 600 simons
        l.movhi r10,hi(_excpt_int)
195
        l.ori   r10,r10,lo(_excpt_int)
196 409 markom
        l.lwz   r10,0(r10)
197 342 markom
        l.jr    r10
198
        l.nop
199
 
200
        .org    0x900
201
_dtlbmiss_vector:
202
        l.addi  r1,r1,-116
203
        l.sw    0x18(r1),r9
204
        l.jal   store_regs
205
        l.nop
206 461 simons
/*
207 410 simons
        l.mfspr r3,r0,SPR_EPCR_BASE
208
        l.addi  r3,r3,-4
209
        l.mtspr r0,r3,SPR_EPCR_BASE
210 461 simons
*/
211 342 markom
        l.movhi r9,hi(end_except)
212 409 markom
        l.ori   r9,r9,lo(end_except)
213
        l.movhi r10,hi(_excpt_dtlbmiss)
214
        l.ori   r10,r10,lo(_excpt_dtlbmiss)
215
        l.lwz   r10,0(r10)
216 342 markom
        l.jr    r10
217
        l.nop
218
 
219
        .org    0xa00
220
_itlbmiss_vector:
221
        l.addi  r1,r1,-116
222
        l.sw    0x18(r1),r9
223
        l.jal   store_regs
224
        l.nop
225
        l.movhi r9,hi(end_except)
226 409 markom
        l.ori   r9,r9,lo(end_except)
227
        l.movhi r10,hi(_excpt_itlbmiss)
228
        l.ori   r10,r10,lo(_excpt_itlbmiss)
229
        l.lwz   r10,0(r10)
230 342 markom
        l.jr    r10
231
        l.nop
232
 
233
        .org    0xb00
234
_range_vector:
235
        l.addi  r1,r1,-116
236
        l.sw    0x18(r1),r9
237
        l.jal   store_regs
238
        l.nop
239
        l.movhi r9,hi(end_except)
240 409 markom
        l.ori   r9,r9,lo(end_except)
241
        l.movhi r10,hi(_excpt_range)
242
        l.ori   r10,r10,lo(_excpt_range)
243
        l.lwz   r10,0(r10)
244 342 markom
        l.jr    r10
245
        l.nop
246
 
247
        .org    0xc00
248
_syscall_vector:
249
        l.addi  r1,r1,-116
250
        l.sw    0x18(r1),r9
251
        l.jal   store_regs
252
        l.nop
253
        l.movhi r9,hi(end_except)
254 409 markom
        l.ori   r9,r9,lo(end_except)
255
        l.movhi r10,hi(_excpt_syscall)
256
        l.ori   r10,r10,lo(_excpt_syscall)
257
        l.lwz   r10,0(r10)
258 342 markom
        l.jr    r10
259
        l.nop
260
 
261
        .org    0xd00
262
_break_vector:
263
        l.addi  r1,r1,-116
264
        l.sw    0x18(r1),r9
265
        l.jal   store_regs
266
        l.nop
267
        l.movhi r9,hi(end_except)
268 409 markom
        l.ori   r9,r9,lo(end_except)
269
        l.movhi r10,hi(_excpt_break)
270
        l.ori   r10,r10,lo(_excpt_break)
271
        l.lwz   r10,0(r10)
272 342 markom
        l.jr    r10
273
        l.nop
274
 
275
        .org    0xe00
276
_trap_vector:
277
        l.addi  r1,r1,-116
278
        l.sw    0x18(r1),r9
279
        l.jal   store_regs
280
        l.nop
281
        l.movhi r9,hi(end_except)
282 409 markom
        l.ori   r9,r9,lo(end_except)
283
        l.movhi r10,hi(_excpt_trap)
284
        l.ori   r10,r10,lo(_excpt_trap)
285
        l.lwz   r10,0(r10)
286 342 markom
        l.jr    r10
287
        l.nop
288
 
289
store_regs:
290
        l.sw    0x00(r1),r3
291
        l.sw    0x04(r1),r4
292
        l.sw    0x08(r1),r5
293
        l.sw    0x0c(r1),r6
294
        l.sw    0x10(r1),r7
295
        l.sw    0x14(r1),r8
296
        l.sw    0x1c(r1),r10
297
        l.sw    0x20(r1),r11
298
        l.sw    0x24(r1),r12
299
        l.sw    0x28(r1),r13
300
        l.sw    0x2c(r1),r14
301
        l.sw    0x30(r1),r15
302
        l.sw    0x34(r1),r16
303
        l.sw    0x38(r1),r17
304
        l.sw    0x3c(r1),r18
305
        l.sw    0x40(r1),r19
306
        l.sw    0x44(r1),r20
307
        l.sw    0x48(r1),r21
308
        l.sw    0x4c(r1),r22
309
        l.sw    0x50(r1),r23
310
        l.sw    0x54(r1),r24
311
        l.sw    0x58(r1),r25
312
        l.sw    0x5c(r1),r26
313
        l.sw    0x60(r1),r27
314
        l.sw    0x64(r1),r28
315
        l.sw    0x68(r1),r29
316
        l.sw    0x6c(r1),r30
317
        l.sw    0x70(r1),r31
318 475 simons
        l.jr    r9
319 342 markom
        l.nop
320
 
321
end_except:
322
        l.lwz   r3,0x00(r1)
323
        l.lwz   r4,0x04(r1)
324
        l.lwz   r5,0x08(r1)
325
        l.lwz   r6,0x0c(r1)
326
        l.lwz   r7,0x10(r1)
327
        l.lwz   r8,0x14(r1)
328
        l.lwz   r9,0x18(r1)
329
        l.lwz   r10,0x1c(r1)
330
        l.lwz   r11,0x20(r1)
331
        l.lwz   r12,0x24(r1)
332
        l.lwz   r13,0x28(r1)
333
        l.lwz   r14,0x2c(r1)
334
        l.lwz   r15,0x30(r1)
335
        l.lwz   r16,0x34(r1)
336
        l.lwz   r17,0x38(r1)
337
        l.lwz   r18,0x3c(r1)
338
        l.lwz   r19,0x40(r1)
339
        l.lwz   r20,0x44(r1)
340
        l.lwz   r21,0x48(r1)
341
        l.lwz   r22,0x4c(r1)
342
        l.lwz   r23,0x50(r1)
343
        l.lwz   r24,0x54(r1)
344
        l.lwz   r25,0x58(r1)
345
        l.lwz   r26,0x5c(r1)
346
        l.lwz   r27,0x60(r1)
347
        l.lwz   r28,0x64(r1)
348
        l.lwz   r29,0x68(r1)
349
        l.lwz   r30,0x6c(r1)
350
        l.lwz   r31,0x70(r1)
351
        l.addi  r1,r1,116
352
        l.rfe
353 413 markom
        l.nop

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.