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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [hwtests/] [memtest2/] [memtest2.s] - Blame information for rev 73

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

Line No. Rev Author Line
1 14 hellwig
;
2
; memtest2.s -- memory test
3
;
4
 
5
; $2 temporary
6
; $3 tbl address
7
; $4 mem address
8
; $5 tbl count
9
; $6 mem count
10
; $7 error
11
; $8 I/O base
12
; $9 value read
13
; $10 reference value
14
 
15
        .set    mem_base,0xC0000000
16
        .set    mem_size,1024*1024
17
        .set    io_base,0xF0300000
18
 
19
        ;
20
        ; write memory
21
        ;
22
write:
23
        add     $4,$0,mem_base
24
        add     $6,$0,mem_size
25
        add     $3,$0,tbl
26
        add     $5,$0,257
27
wrloop:
28
        ldbu    $2,$3,0
29
        stb     $2,$4,0
30
        add     $3,$3,1
31
        sub     $5,$5,1
32
        bne     $5,$0,wrloop1
33
        add     $3,$0,tbl
34
        add     $5,$0,257
35
wrloop1:
36
        add     $4,$4,1
37
        sub     $6,$6,1
38
        bne     $6,$0,wrloop
39
        ;
40
        ; read memory
41
        ;
42
read:
43
        add     $4,$0,mem_base
44
        add     $6,$0,mem_size
45
        add     $3,$0,tbl
46
        add     $5,$0,257
47
        add     $7,$0,0
48
rdloop:
49
        ; always check byte
50
byte:
51
        ldbu    $9,$4,0
52
        ldbu    $10,$3,0
53
        beq     $9,$10,byteok
54
        add     $7,$0,1
55
byteok:
56
        ; possibly check halfword
57
half:
58
        and     $2,$4,1
59
        bne     $2,$0,halfok
60
        ldhu    $9,$4,0
61
        ldbu    $10,$3,0
62
        jal     shft8
63
        ldbu    $2,$3,1
64
        or      $10,$10,$2
65
        beq     $9,$10,halfok
66
        add     $7,$0,1
67
halfok:
68
        ; possibly check word
69
word:
70
        and     $2,$4,3
71
        bne     $2,$0,wordok
72
        ldw     $9,$4,0
73
        ldbu    $10,$3,0
74
        jal     shft8
75
        ldbu    $2,$3,1
76
        or      $10,$10,$2
77
        jal     shft8
78
        ldbu    $2,$3,2
79
        or      $10,$10,$2
80
        jal     shft8
81
        ldbu    $2,$3,3
82
        or      $10,$10,$2
83
        beq     $9,$10,wordok
84
        add     $7,$0,1
85
wordok:
86
        ; next address
87
        add     $3,$3,1
88
        sub     $5,$5,1
89
        bne     $5,$0,rdloop1
90
        add     $3,$0,tbl
91
        add     $5,$0,257
92
rdloop1:
93
        add     $4,$4,1
94
        sub     $6,$6,1
95
        bne     $6,$0,rdloop
96
        ;
97
        ; show result
98
        ;
99
        bne     $7,$0,error
100
ok:
101
        add     $7,$0,'.'
102
        jal     out
103
        j       halt
104
error:
105
        add     $7,$0,'?'
106
        jal     out
107
        j       halt
108
        ;
109
        ; finally, halt
110
        ;
111
halt:
112
        j       halt
113
 
114
shft8:
115
        add     $10,$10,$10
116
        add     $10,$10,$10
117
        add     $10,$10,$10
118
        add     $10,$10,$10
119
        add     $10,$10,$10
120
        add     $10,$10,$10
121
        add     $10,$10,$10
122
        add     $10,$10,$10
123
        jr      $31
124
 
125
out:
126
        add     $8,$0,io_base
127
out1:
128
        ldw     $9,$8,8
129
        and     $9,$9,1
130
        beq     $9,$0,out1
131
        stw     $7,$8,12
132
        jr      $31
133
 
134
tbl:
135
        .byte   0x45,0x23,0x98,0x48,0xDC,0x5C,0x94,0x58
136
        .byte   0x1F,0x7C,0x58,0xD7,0x41,0x1E,0xA9,0xE1
137
        .byte   0x00,0x62,0x08,0x27,0x23,0xE9,0xCD,0x43
138
        .byte   0x0F,0x25,0xF9,0x72,0xC2,0xD7,0xC4,0x07
139
        .byte   0xFB,0x5D,0x50,0xD7,0xBA,0xE4,0x30,0xD9
140
        .byte   0x61,0x89,0xB1,0xA3,0xA8,0x5A,0x84,0xA8
141
        .byte   0xBD,0x8C,0xD0,0xE0,0x76,0x9E,0x24,0x86
142
        .byte   0xC4,0x1D,0xF8,0x86,0xF5,0xBD,0x8D,0xF0
143
        .byte   0x1A,0xDD,0xC8,0xD4,0xC2,0xF8,0xAD,0x23
144
        .byte   0x82,0x5F,0xC6,0x2A,0xB9,0x4A,0xD3,0x77
145
        .byte   0xD7,0xA4,0x58,0x4E,0x42,0x7C,0xD4,0x06
146
        .byte   0x9A,0xCC,0x8D,0x8F,0x89,0x1B,0x7F,0xA4
147
        .byte   0xF9,0x48,0x78,0xBB,0x40,0x26,0xDE,0xC3
148
        .byte   0x85,0xA5,0xED,0x3F,0xF0,0xC1,0xB7,0xC7
149
        .byte   0x65,0x0F,0x15,0xA8,0x8C,0xE9,0xAF,0x26
150
        .byte   0xB6,0x3C,0xB6,0x40,0x57,0x35,0xE4,0x50
151
        .byte   0x7E,0x5D,0x0B,0xBF,0x84,0xEA,0x82,0x0A
152
        .byte   0x8F,0x70,0x4A,0x7F,0x31,0x02,0x47,0x96
153
        .byte   0x12,0x5D,0x3F,0x9E,0x47,0xEE,0xC5,0xFD
154
        .byte   0x2B,0x7B,0x3E,0x82,0xB1,0x23,0xD3,0x2F
155
        .byte   0x81,0xDF,0xEE,0x06,0xCA,0x70,0x11,0x59
156
        .byte   0xE0,0x5B,0xD9,0x11,0x5E,0x21,0xA8,0x70
157
        .byte   0x7E,0xE7,0x0E,0xC5,0xD6,0xD4,0xC3,0x01
158
        .byte   0x4F,0x01,0x84,0x01,0x24,0x57,0x30,0xA5
159
        .byte   0x37,0x1E,0xAC,0x01,0x8F,0xBD,0x5A,0x70
160
        .byte   0x18,0x34,0x82,0x77,0x55,0x2A,0xE7,0xD3
161
        .byte   0x12,0xF6,0x99,0xE8,0xCA,0x5C,0xEA,0x1A
162
        .byte   0x5D,0x6E,0x1B,0x82,0xC5,0x4B,0x28,0xFD
163
        .byte   0x6A,0xD4,0xFE,0xFA,0x91,0x59,0x6A,0xAA
164
        .byte   0x8D,0xEC,0x21,0xE3,0x17,0x09,0xB7,0x29
165
        .byte   0xFF,0x50,0x12,0xC9,0xAC,0xFC,0xE3,0x0A
166
        .byte   0x6B,0xFF,0x8D,0x31,0x4A,0xB5,0x2E,0xB5
167
        .byte   0x8A
168
augment:
169
        .byte   0x45,0x23,0x98

powered by: WebSVN 2.1.0

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