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 410

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

powered by: WebSVN 2.1.0

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