ai.tst
10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
//****************************************************************************
//
// File: ai.tst
// Test file for Audio Interface (AI)
//
// File Format:
//
// t <id> <arg1> <arg2> <arg3> <arg4> - Run test id with the 4 args
// where id = decimal number
// argX = hex number
// q - Quit testing and shutdown verilog
// server
//
//****************************************************************************
//****************************************************************************
// Configure RDRAM
//
t 0000 00000000 00000000 00000000 00000000
//****************************************************************************
// Init RDRAM with pattern data (rdram_addr, nbytes, pattern_key)
t 0013 00000000 00000040 87654321 00000000
// Init Video Interface (VI) to get proper video clock signal into AI
t 0102 04400000 00000000 00000000 00000000
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// Set DAC rate
//t 0102 04500010 00000086 00000000 00000000
// Set bit rate
//t 0102 04500014 00000001 00000000 00000000
// Enable DMA
//t 0102 04500008 00000001 00000000 00000000
//****************************************************************************
// Test AI DMA: dram_address, nbytes
//****************************************************************************
// DMA 20 Bytes (RDRAM -> AI) -> SHOULD PASS
// Note: Address and data must be 8-byte aligned
//
t 0043 00000000 00000014 00000000 00000000
// Perform a CPU memory read
t 0100 00000008 00000000 00000000 00000000
// Disable DMA
t 0102 04500008 00000000 00000000 00000000
// Perform a CPU memory write and compare
t 0103 00000010 01010101 01010101 00000000
// Check for interrupt bit set (bit 2)
t 0104 04300008 00000004 00000000 00000000
// Now, test for DMA busy bit
//t 0046 40000000 00000000 00000000 00000000
t 0104 0450000c 40000000 00000001 00000000
// Enable DMA
t 0102 04500008 00000001 00000000 00000000
// Check for interrupt bit set (bit 2)
t 0104 04300008 00000004 00000000 00000000
// Clear interrupt bit
t 0102 0450000C 00000000 00000000 00000000
// Check for interrupt bit reset (bit 2)
t 0104 04300008 00000004 00000001 00000000
// DMA again
t 0043 00000008 00000008 00000000 00000000
// Check for busy bit
t 0104 0450000c 40000000 00000001 00000000
//****************************************************************************
// Here, we stall in verilog for X cycles to make sure that data is shifted
// out to Audio DAC
// Wait for around 3000 cycles
t 0014 00000300 00000000 00000000 00000000
//****************************************************************************
// Init Ai (DAC rate, bit rate, DMA enable)
//t 003 00000090 00000002 00000000 00000000
//****************************************************************************
// DMA 16 Bytes (RDRAM -> AI) -> SHOULD PASS
// Note: Address and data must be 8-byte aligned
//
t 0043 00000020 00000010 00000000 00000000
// Here we're reading length register until it's empty
//t 0045 04500004 00000000 00000000 00000000
// Perform a CPU memory read
t 0100 00000010 00000000 00000000 00000000
// Disable DMA
t 0102 04500008 00000000 00000000 00000000
// Perform a CPU memory write and compare
t 0103 00000020 01010101 01010101 00000000
// Check for interrupt bit set (bit 2)
t 0104 04300008 00000004 00000000 00000000
// Now, test for DMA busy bit
t 0104 0450000c 40000000 00000001 00000000
// Enable DMA
t 0102 04500008 00000001 00000000 00000000
// Check for interrupt bit set (bit 2)
t 0104 04300008 00000004 00000000 00000000
// Clear interrupt bit
t 0102 0450000C 00000000 00000000 00000000
// Check for interrupt bit reset (bit 2)
t 0104 04300008 00000004 00000001 00000000
// Check for busy bit
t 0104 0450000c 40000000 00000001 00000000
//****************************************************************************
// Here, we stall in verilog for X cycles to make sure that data is shifted
// out to Audio DAC
// Wait for around 4000 cycles
t 0014 00000400 00000000 00000000 00000000
//****************************************************************************
// Test AI length counter: repeatdly start a dma with a length and
// check for the count to decrement to next bit position
// relies on rdram data being previously loaded
// Init Video Interface (VI) to get proper video clock signal into AI
t 0102 04400000 00000000 00000000 00000000
//****************************************************************************
// ** test msb bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00020000 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 0001fff8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00010000 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 0000fff8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00008000 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00007ff8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00004000 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00003ff8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00002000 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00001ff8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00001000 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00000ff8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000800 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 000007f8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000400 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 000003f8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000200 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 000001f8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000100 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 000000f8 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000080 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00000078 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000040 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00000038 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000020 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00000018 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000010 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00000008 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** test next bit of counter
// Configure Ai (DAC rate, bit rate) with DMA enable
t 003 00000086 00000001 00000000 00000000
// start ai dma of specified length
t 0048 00000000 00000008 00000000 00000000
// spin on length decrementing to specified value -> SHOULD PASS
t 0049 00000000 00000000 00000000 00000000
// soft reset (bit rate 0) to stop the dma in progress
t 003 00000000 00000000 00000000 00000000
//** note will need to restore dac counter for any further tests
//****************************************************************************
// QUIT
//****************************************************************************
q