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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [testbench/] [except_mc.S] - Blame information for rev 1778

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

Line No. Rev Author Line
1 453 ivang
/* Support file for c based tests */
2
#include "spr_defs.h"
3
 
4
#define reset _reset
5
 
6
        .section .stack
7
        .space 0x1000
8
_stack:
9
 
10
        .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 453 ivang
        .extern _excpt_align
18
        .extern _excpt_illinsn
19 600 simons
        .extern _excpt_int
20 453 ivang
        .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
        l.addi  r4,r0,0x0
33
        l.addi  r5,r0,0x0
34
        l.addi  r6,r0,0x0
35
        l.addi  r7,r0,0x0
36
        l.addi  r8,r0,0x0
37
        l.addi  r9,r0,0x0
38
        l.addi  r10,r0,0x0
39
        l.addi  r11,r0,0x0
40
        l.addi  r12,r0,0x0
41
        l.addi  r13,r0,0x0
42
        l.addi  r14,r0,0x0
43
        l.addi  r15,r0,0x0
44
        l.addi  r16,r0,0x0
45
        l.addi  r17,r0,0x0
46
        l.addi  r18,r0,0x0
47
        l.addi  r19,r0,0x0
48
        l.addi  r20,r0,0x0
49
        l.addi  r21,r0,0x0
50
        l.addi  r22,r0,0x0
51
        l.addi  r23,r0,0x0
52
        l.addi  r24,r0,0x0
53
        l.addi  r25,r0,0x0
54
        l.addi  r26,r0,0x0
55
        l.addi  r27,r0,0x0
56
        l.addi  r28,r0,0x0
57
        l.addi  r29,r0,0x0
58
        l.addi  r30,r0,0x0
59
        l.addi  r31,r0,0x0
60
 
61
        l.j     init_mc
62
        l.nop
63
 
64
start:  l.movhi r1,hi(_stack)
65
        l.ori   r1,r1,lo(_stack)
66
 
67
        /* Check if this is RTL version */
68
        l.lbz   r3,0(r0)
69
        l.sfeqi r3,0xff
70
        l.bf    2f
71
        l.nop
72
        l.movhi r3,hi(_src_beg)
73
        l.ori   r3,r3,lo(_src_beg)
74
        l.movhi r4,hi(_dst_beg)
75
        l.ori   r4,r4,lo(_dst_beg)
76
        l.movhi r5,hi(_dst_end)
77
        l.ori   r5,r5,lo(_dst_end)
78
        l.sub   r5,r5,r4
79
        l.sfeqi r5,0
80
        l.bf    2f
81
        l.nop
82
1:      l.lwz   r6,0(r3)
83
        l.sw    0(r4),r6
84
        l.addi  r3,r3,4
85
        l.addi  r4,r4,4
86
        l.addi  r5,r5,-4
87
        l.sfgtsi r5,0
88
        l.bf    1b
89
        l.nop
90
 
91
2:
92
 
93
        l.movhi r2,hi(reset)
94
        l.ori   r2,r2,lo(reset)
95
        l.jr    r2
96
        l.nop
97
 
98
        .org    0x200
99
_buserr_vector:
100
        l.addi  r1,r1,-116
101
        l.sw    0x18(r1),r9
102
        l.jal   store_regs
103
        l.nop
104
        l.movhi r9,hi(end_except)
105
        l.ori   r9,r9,lo(end_except)
106
        l.movhi r10,hi(_excpt_buserr)
107
        l.ori   r10,r10,lo(_excpt_buserr)
108
        l.lwz   r10,0x0(r10)
109
        l.jr    r10
110
        l.nop
111
 
112
        .org    0x300
113
_dpfault_vector:
114
        l.addi  r1,r1,-116
115
        l.sw    0x18(r1),r9
116
        l.jal   store_regs
117
        l.nop
118
 
119
        l.mfspr r3,r0,SPR_EPCR_BASE
120
        l.addi  r3,r3,-4
121
        l.mtspr r0,r3,SPR_EPCR_BASE
122
 
123
        l.movhi r9,hi(end_except)
124
        l.ori   r9,r9,lo(end_except)
125
        l.movhi r10,hi(_excpt_dpfault)
126
        l.ori   r10,r10,lo(_excpt_dpfault)
127
        l.lwz   r10,0(r10)
128
        l.jr    r10
129
        l.nop
130
 
131
        .org    0x400
132
_ipfault_vector:
133
        l.addi  r1,r1,-116
134
        l.sw    0x18(r1),r9
135
        l.jal   store_regs
136
        l.nop
137
        l.movhi r9,hi(end_except)
138
        l.ori   r9,r9,lo(end_except)
139
        l.movhi r10,hi(_excpt_ipfault)
140
        l.ori   r10,r10,lo(_excpt_ipfault)
141
        l.lwz   r10,0(r10)
142
        l.jr    r10
143
        l.nop
144
 
145
        .org    0x500
146
_lpint_vector:
147
        l.addi  r1,r1,-116
148
        l.sw    0x18(r1),r9
149
        l.jal   store_regs
150
        l.nop
151
        l.movhi r9,hi(end_except)
152
        l.ori   r9,r9,lo(end_except)
153 600 simons
        l.movhi r10,hi(_excpt_tick)
154
        l.ori   r10,r10,lo(_excpt_tick)
155 453 ivang
        l.lwz   r10,0(r10)
156
        l.jr    r10
157
        l.nop
158
 
159
        .org    0x600
160
_align_vector:
161
        l.addi  r1,r1,-116
162
        l.sw    0x18(r1),r9
163
        l.jal   store_regs
164
        l.nop
165
        l.movhi r9,hi(end_except)
166
        l.ori   r9,r9,lo(end_except)
167
        l.movhi r10,hi(_excpt_align)
168
        l.ori   r10,r10,lo(_excpt_align)
169
        l.lwz   r10,0(r10)
170
        l.jr    r10
171
        l.nop
172
 
173
        .org    0x700
174
_illinsn_vector:
175
        l.addi  r1,r1,-116
176
        l.sw    0x18(r1),r9
177
        l.jal   store_regs
178
        l.nop
179
        l.movhi r9,hi(end_except)
180
        l.ori   r9,r9,lo(end_except)
181
        l.movhi r10,hi(_excpt_illinsn)
182
        l.ori   r10,r10,lo(_excpt_illinsn)
183
        l.lwz   r10,0(r10)
184
        l.jr    r10
185
        l.nop
186
 
187
        .org    0x800
188
_hpint_vector:
189
        l.addi  r1,r1,-116
190
        l.sw    0x18(r1),r9
191
        l.jal   store_regs
192
        l.nop
193
        l.movhi r9,hi(end_except)
194
        l.ori   r9,r9,lo(end_except)
195 600 simons
        l.movhi r10,hi(_excpt_int)
196
        l.ori   r10,r10,lo(_excpt_int)
197 453 ivang
        l.lwz   r10,0(r10)
198
        l.jr    r10
199
        l.nop
200
 
201
        .org    0x900
202
_dtlbmiss_vector:
203
        l.addi  r1,r1,-116
204
        l.sw    0x18(r1),r9
205
        l.jal   store_regs
206
        l.nop
207
 
208
        l.mfspr r3,r0,SPR_EPCR_BASE
209
        l.addi  r3,r3,-4
210
        l.mtspr r0,r3,SPR_EPCR_BASE
211
 
212
        l.movhi r9,hi(end_except)
213
        l.ori   r9,r9,lo(end_except)
214
        l.movhi r10,hi(_excpt_dtlbmiss)
215
        l.ori   r10,r10,lo(_excpt_dtlbmiss)
216
        l.lwz   r10,0(r10)
217
        l.jr    r10
218
        l.nop
219
 
220
        .org    0xa00
221
_itlbmiss_vector:
222
        l.addi  r1,r1,-116
223
        l.sw    0x18(r1),r9
224
        l.jal   store_regs
225
        l.nop
226
        l.movhi r9,hi(end_except)
227
        l.ori   r9,r9,lo(end_except)
228
        l.movhi r10,hi(_excpt_itlbmiss)
229
        l.ori   r10,r10,lo(_excpt_itlbmiss)
230
        l.lwz   r10,0(r10)
231
        l.jr    r10
232
        l.nop
233
 
234
        .org    0xb00
235
_range_vector:
236
        l.addi  r1,r1,-116
237
        l.sw    0x18(r1),r9
238
        l.jal   store_regs
239
        l.nop
240
        l.movhi r9,hi(end_except)
241
        l.ori   r9,r9,lo(end_except)
242
        l.movhi r10,hi(_excpt_range)
243
        l.ori   r10,r10,lo(_excpt_range)
244
        l.lwz   r10,0(r10)
245
        l.jr    r10
246
        l.nop
247
 
248
        .org    0xc00
249
_syscall_vector:
250
        l.addi  r1,r1,-116
251
        l.sw    0x18(r1),r9
252
        l.jal   store_regs
253
        l.nop
254
        l.movhi r9,hi(end_except)
255
        l.ori   r9,r9,lo(end_except)
256
        l.movhi r10,hi(_excpt_syscall)
257
        l.ori   r10,r10,lo(_excpt_syscall)
258
        l.lwz   r10,0(r10)
259
        l.jr    r10
260
        l.nop
261
 
262
        .org    0xd00
263
_break_vector:
264
        l.addi  r1,r1,-116
265
        l.sw    0x18(r1),r9
266
        l.jal   store_regs
267
        l.nop
268
        l.movhi r9,hi(end_except)
269
        l.ori   r9,r9,lo(end_except)
270
        l.movhi r10,hi(_excpt_break)
271
        l.ori   r10,r10,lo(_excpt_break)
272
        l.lwz   r10,0(r10)
273
        l.jr    r10
274
        l.nop
275
 
276
        .org    0xe00
277
_trap_vector:
278
        l.addi  r1,r1,-116
279
        l.sw    0x18(r1),r9
280
        l.jal   store_regs
281
        l.nop
282
        l.movhi r9,hi(end_except)
283
        l.ori   r9,r9,lo(end_except)
284
        l.movhi r10,hi(_excpt_trap)
285
        l.ori   r10,r10,lo(_excpt_trap)
286
        l.lwz   r10,0(r10)
287
        l.jr    r10
288
        l.nop
289
 
290
store_regs:
291
        l.sw    0x00(r1),r3
292
        l.sw    0x04(r1),r4
293
        l.sw    0x08(r1),r5
294
        l.sw    0x0c(r1),r6
295
        l.sw    0x10(r1),r7
296
        l.sw    0x14(r1),r8
297
        l.sw    0x1c(r1),r10
298
        l.sw    0x20(r1),r11
299
        l.sw    0x24(r1),r12
300
        l.sw    0x28(r1),r13
301
        l.sw    0x2c(r1),r14
302
        l.sw    0x30(r1),r15
303
        l.sw    0x34(r1),r16
304
        l.sw    0x38(r1),r17
305
        l.sw    0x3c(r1),r18
306
        l.sw    0x40(r1),r19
307
        l.sw    0x44(r1),r20
308
        l.sw    0x48(r1),r21
309
        l.sw    0x4c(r1),r22
310
        l.sw    0x50(r1),r23
311
        l.sw    0x54(r1),r24
312
        l.sw    0x58(r1),r25
313
        l.sw    0x5c(r1),r26
314
        l.sw    0x60(r1),r27
315
        l.sw    0x64(r1),r28
316
        l.sw    0x68(r1),r29
317
        l.sw    0x6c(r1),r30
318
        l.sw    0x70(r1),r31
319 475 simons
        l.jr    r9
320 453 ivang
        l.nop
321
 
322
end_except:
323
        l.lwz   r3,0x00(r1)
324
        l.lwz   r4,0x04(r1)
325
        l.lwz   r5,0x08(r1)
326
        l.lwz   r6,0x0c(r1)
327
        l.lwz   r7,0x10(r1)
328
        l.lwz   r8,0x14(r1)
329
        l.lwz   r9,0x18(r1)
330
        l.lwz   r10,0x1c(r1)
331
        l.lwz   r11,0x20(r1)
332
        l.lwz   r12,0x24(r1)
333
        l.lwz   r13,0x28(r1)
334
        l.lwz   r14,0x2c(r1)
335
        l.lwz   r15,0x30(r1)
336
        l.lwz   r16,0x34(r1)
337
        l.lwz   r17,0x38(r1)
338
        l.lwz   r18,0x3c(r1)
339
        l.lwz   r19,0x40(r1)
340
        l.lwz   r20,0x44(r1)
341
        l.lwz   r21,0x48(r1)
342
        l.lwz   r22,0x4c(r1)
343
        l.lwz   r23,0x50(r1)
344
        l.lwz   r24,0x54(r1)
345
        l.lwz   r25,0x58(r1)
346
        l.lwz   r26,0x5c(r1)
347
        l.lwz   r27,0x60(r1)
348
        l.lwz   r28,0x64(r1)
349
        l.lwz   r29,0x68(r1)
350
        l.lwz   r30,0x6c(r1)
351
        l.lwz   r31,0x70(r1)
352
        l.addi  r1,r1,116
353
        l.rfe
354
        l.nop
355
 
356
init_mc:
357
        l.movhi r0, 0x0
358
        l.slli  r0,r0,16
359
 
360
/* Set speed of FLASH access */
361
/* TMS[0] = 0x00000210       */
362
/* TMS address = 0x60000014  */
363
        l.ori   r2,r0,0x020a
364
        l.movhi r3, 0x6000
365
        l.ori   r1,r3,0x0014
366
        l.sw    0(r1),r2
367
 
368
/* Set SDRAM parameters for CS1    */
369
/* old TMS[1] (*6000001c) = 0xfffff020 */
370
/* old CSC[1] (*60000018) = 0x00200611 */
371
/* CSR (*60000000) = 0x60300300    */
372
/* BA_MASK (*60000008) = 0x000000f0 */
373
 
374
/* TMS[1] (*6000001c) = 0xfffff023 */
375
/* CSC[1] (*60000018) = 0x00200491 */
376
        l.movhi r2,0x6030
377
        l.ori   r2,r2,0x0300
378
        l.ori   r1,r3,0x0000
379
        l.sw    0(r1),r2
380
        l.movhi r2,0x0000
381
        l.ori   r2,r2,0x00f0
382
        l.ori   r1,r3,0x0008
383
        l.sw    0(r1),r2
384
        l.movhi r2,0x0724
385
        l.ori   r2,r2,0x8230
386
        l.ori   r1,r3,0x001c
387
        l.sw    0(r1),r2
388
        l.movhi r2,0x0020
389
        l.ori   r2,r2,0x0411
390
        l.ori   r1,r3,0x0018
391
        l.sw    0(r1),r2
392
        l.xor   r0,r0,r0
393
        l.xor   r1,r1,r1
394
        l.xor   r2,r2,r2
395
        l.xor   r3,r3,r3
396
        l.j     start
397
        l.nop

powered by: WebSVN 2.1.0

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