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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [except.S] - Blame information for rev 413

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

powered by: WebSVN 2.1.0

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