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

Subversion Repositories t400

[/] [t400/] [trunk/] [sw/] [verif/] [black_box/] [xas/] [test.asm] - Blame information for rev 6

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

Line No. Rev Author Line
1 6 arniml
        ;; *******************************************************************
2
        ;; $Id: test.asm,v 1.1 2006-05-06 13:16:36 arniml Exp $
3
        ;;
4
        ;; Checks the XAS instruction.
5
        ;;
6
 
7
        ;; the cpu type is defined on asl's command line
8
 
9
        org     0x00
10
        clra
11
 
12
        ;; *******************************************************************
13
        ;; Test counter functionality
14
        ;;
15
        lei     0x5
16
        ;; enable counter
17
        clra
18
        camq
19
 
20
        ;; clear SKL
21
        xas
22
 
23
        ;; -------------------------------------------------------------------
24
        ;; step 1
25
        ;; decrement counter from 1 to 0
26
        ;; test SO by controlling SI via SO
27
        ;;
28
        ;; load 0x1 to counter
29
        clra
30
        aisc    0x1
31
        xas
32
        ;; decrement via SO
33
        lei     0xd
34
        nop                     ; ensure minimum '1' duration
35
        lei     0x5
36
        nop                     ;
37
        nop                     ; ensure minimum '0' duration
38
        nop                     ;
39
        xas
40
        ;; check for 0x0
41
        xad     3, 15
42
        clra
43
        x       0
44
        xad     3, 15
45
        ske
46
        jmp     fail
47
 
48
        ;; -------------------------------------------------------------------
49
        ;; step 2
50
        ;; decrement counter from 0 to 0xf
51
        ;; test SKL by controlling SI via SK
52
        ;;
53
        ;; set SKL to '1'
54
        sc                      ; SKL = '1'
55
        xas
56
        ;; load 0x0 to counter, decrement via SK
57
        clra
58
        rc
59
        xas
60
        nop                     ;
61
        nop                     ; ensure minimum '0' duration
62
        nop                     ;
63
        xas
64
        ;; check for 0xf
65
        xad     3, 15
66
        clra
67
        aisc    0xf
68
        x       0
69
        xad     3, 15
70
        ske
71
        jmp     fail
72
 
73
 
74
        ;; -------------------------------------------------------------------
75
        ;; step 3
76
        ;; check minimum high time on SI
77
        ;;
78
        ;; load 0x0 to counter
79
        clra
80
        xas
81
        ;; clock on SI
82
        lei     0xd
83
        lei     0x5             ; high time too short
84
        nop                     ;
85
        nop                     ; ensure minimum '0' duration
86
        nop                     ;
87
        xas
88
        ;; check for 0x0
89
        xad     3, 15
90
        clra
91
        x       0
92
        xad     3, 15
93
        ske
94
        jmp     fail
95
 
96
        ;; -------------------------------------------------------------------
97
        ;; step 4
98
        ;; check minimum low time on SI
99
        ;;
100
        ;; load 0x0 to counter
101
        clra
102
        xas
103
        ;; clock on SI
104
        lei     0xd
105
        nop                     ; ensure minimum '1' duration
106
        lei     0x5
107
        lei     0xd             ; low time too short
108
        xas
109
        ;; check for 0x0
110
        xad     3, 15
111
        clra
112
        x       0
113
        xad     3, 15
114
        ske
115
        jmp     fail
116
 
117
 
118
        ;; *******************************************************************
119
        ;; Test shift register functionality
120
        ;;
121
        lei     0xc             ; SO = SIO output
122
        ;; enable shift register
123
        aisc    0x1
124
        camq
125
 
126
        ;; shift out 0x5
127
        aisc    0x4
128
        sc
129
        xas
130
        ;;
131
        nop                     ;
132
        nop                     ; shift for four clocks on SK
133
        rc                      ;
134
        xas                     ; stop SK
135
        ;; check for 0x2
136
        xad     3, 15
137
        clra
138
        aisc    0x2
139
        x       0
140
        xad     3, 15
141
        ske
142
        jmp     fail
143
 
144
        ;; shift out 0x0
145
        clra
146
        sc
147
        xas
148
        ;;
149
        nop                     ;
150
        nop                     ; shift for four clocks on SK
151
        rc                      ;
152
        xas                     ; stop SK
153
        ;; check for 0x8
154
        xad     3, 15
155
        clra
156
        aisc    0x8
157
        x       0
158
        xad     3, 15
159
        ske
160
        jmp     fail
161
 
162
        ;; now disable SO and check that only '0' is shifted in
163
        lei     0x4             ; SO = '0'
164
        ;; shift out 0xf
165
        clra
166
        aisc    0xf
167
        sc
168
        xas
169
        ;;
170
        nop                     ;
171
        nop                     ; shift for four clocks on SK
172
        rc                      ;
173
        xas                     ; stop SK
174
        ;; check for 0x0
175
        xad     3, 15
176
        clra
177
        x       0
178
        xad     3, 15
179
        ske
180
        jmp     fail
181
 
182
        ;; enable SO
183
        lei     0xc
184
        ;; shift out 0x1 to force SI to '1' via SO
185
        clra
186
        aisc    0x1
187
        sc
188
        xas
189
        ;;
190
        nop                     ;
191
        nop                     ; shift for four clocks on SK
192
        rc                      ;
193
        xas                     ; stop SK
194
        ;; shift out 0x0 with disabled SK
195
        clra
196
        xas
197
        ;;
198
        nop                     ;
199
        nop                     ; shift for four clocks on SK
200
        nop                     ;
201
        xas
202
        ;; check for 0xf
203
        xad     3, 15
204
        clra
205
        aisc    0xf
206
        x       0
207
        xad     3, 15
208
        ske
209
        jmp     fail
210
 
211
        jmp     pass
212
 
213
        org     0x100
214
        include "pass_fail.asm"

powered by: WebSVN 2.1.0

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