si-dv.html
10.7 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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<html>
<head>
<title>
Project BB - SI DV Plan
</title>
</head>
<body bgcolor="#ffffff" text="#000000"
link="#004868" vlink="#986424" alink="#00ffff">
<table width="100%" cellpadding=2 cellspacing=0 border=0>
<tr>
<td bgcolor="#e0e0e0">
Project BB - SI DV Plan
</td>
<td align=right bgcolor="#f0c0c0" width="20%">
<font color=red>
<b>Broad<i>On</i> confidential</b>
</font>
</td>
</tr>
</table>
<p>
<b><u> SI Related DV Tasks </u></b>
<p>
<li> add controller backdoor to IPC interface,
one interface for both local and JoyChannel controllers;
<li> implement new SI functional tests;
<li> implement SI random tests for system stress;
<p>
<b><u> The JoyChannel Controller Model (jctrl.v) </u></b>
<p>
The top level simulation model instantiates three behavioral
JoyChannel controllers, <i>vsim.jctrl1</i>, <i>vsim.jctrl2</i>
and <i>vsim.jctrl3</i>. The behavioral model allows control over
several modes and button events. The list below descibes all DV
accessible registers and their default settings. Refer to the
<i>N64 JoyChannel Protocol Specification</i> for details.
<dl>
<dt> <code>vsim.jctrlX.jctrl_mon</code>, set by +jctrl_mon
<dd> local controller monitor;
<br>
Setting jctrl_mon to 1 enables logging of JoyChannel controller
events into the simulation log.
<p>
<dt> <code>vsim.jctrlX.enable</code>, default 0
<dd> flag to disable (0) or enable (1) the controller;
<br>
This should be used to test the <i>no response</i> flag in the
SI status of the channel.
<p>
<dt> <code>vsim.jctrlX.div</code> [3:0], default 9 to divide by 10
<dd> controller internal speed;
<br>
This divider controls the speed of the channel. A 10MHz clock is
divided by (div + 1) to create the clock for the serial protocol.
The divider should be used to test minumum and maximum channel
speeds. For example, 10MHz / (9 + 1) = 1us per pulse. Each bit
requires four pulses, ie. 1us * 4 = 4us, ie. 250kbits/s.
<p>
<dt> <code>vsim.jctrlX.type_l</code>, default 0x02
<dt> <code>vsim.jctrlX.type_h</code>, default 0x00
<dt> <code>vsim.jctrlX.status</code>, default 0x00
<dd> type low, type high and status;
<p>
<dt> <code>vsim.jctrlX.button</code>, default 0x0000
<dd> buttons pressed, one bit per button
<p>
<dt> <code>vsim.jctrlX.x</code>, default 0
<dt> <code>vsim.jctrlX.y</code>, default 0
<dd> x/y position of joystick;
<p>
<dt> <code>vsim.jctrlX.rsp_random</code>, default 0
<dd> response randomization;
<br>
Tells the model to randomize bit stream timing and delay behavior
within legal JoyChannel limits. This should be set in system DV,
as it changes SI and controller event timing. This option can be used
in master mode.
<p>
<dt> <code>vsim.jctrlX.rsp_echo</code>, default 0
<dd> response echo;
<br>
Tells the model to respond with the byte received in the command.
Specifically, cmd[1:0] encodes the number of tx/rx bytes, 0 means one
byte, 3 means 4 bytes. This should be used to test JoyChannel commands
other than the suported RESET, QUERY and STATUS. This option cannot
be used in master mode.
<p>
<dt> <code>vsim.jctrlX.collide</code>, [3:0], default 0
<dd> force JoyChannel collision;
<br>
When bit 3 is 1, the controller forces a JoyChannel collision
during bit [2:0] of the command phase. This should be used to
test the <i>collision error</i> bit in the SI for the channel.
<p>
<dt> <code>vsim.jctrlX.framerr</code>, [5:0], default 0
<dd> force JoyChannel frame error;
<br>
When bit 5 is 1, the controller forces a JoyChannel frame error
during bit [4:0] of the response phase. This should be used to
test the <i>frame error</i> bit in the SI for the channel.
<p>
<dt> <code>vsim.jctrlX.glitch_detect</code>, default 1
<dd> enable/disable glitch detection;
<br>
This bit durns on (1) or off (0) glitch detection.
It should be set to 0 for JoyChannel error testing.
<p>
<dt> <code>vsim.jctrlX.reset</code>, default 0
<dd> force JoyChannel reset;
<br>
Set this bit to 1 to force a JoyChannel reset (0 on wire).
This overwrites all other activity but does not stop it.
DV environment is responsible for timing. The model does not
need to be enables for the reset to work.
<p>
<dt> <code>vsim.jctrlX.master</code>, default 0 (slave)
<dd> puts controller into master mode for si slave testing;
<br>
When this bit is set the mode switches from slave mode to master mode.
<p>
<dt> <code>vsim.jctrlX.tx_size</code>
<dd> transmit size in byte in master mode;
<p>
<dt> <code>vsim.jctrlX.tx_data[0:35]</code>
<dd> transmit data in master mode, 0=cmd 1..35=data;
<p>
<dt> <code>vsim.jctrlX.tx_on</code>
<dd> master transmission start;
<br>
Set this bit to 1 to start command transmission in master mode.
This bit is cleared when transmission is finished. A 64us JoyChannel
protocol delay between transmissions must be observed by the dv
environment.
<p>
<dt> <code>vsim.jctrlX.rx_size</code>
<dd> number of bytes in received response;
<p>
<dt> <code>vsim.jctrlX.rx_last</code>
<dd> number of response bytes in addition to cmd byte;
<br>
This variable has to be set to the number of data bytes.
<p>
<dt> <code>vsim.jctrlX.rx_data[0:35]</code>
<dd> response data from master, 0=cmd, 1..35=data;
</dl>
<p>
<b><u> The Local Controller Model (lctrl.v) </u></b>
<p>
The top level simulation model instantiates one behavioral model
for the local controller, <i>vsim.lctrl</i>. The model allows
control over several modes, button events and x/y motion events.
The list below descibes all DV accessible registers and their
default settings. Refer to the <i>N64 JoyChannel Protocol
Specification</i> for details.
<p>
The local controller is always enabled. The SI needs four JoyChannel
clocks for de-glitching of the x/y inputs. The fastest simulation of
x/y stick motion thus requires (tXfer + tHigh + tXfer + tLow)ns for
one count of x/y position change.
<dl>
<dt> <code>vsim.lctrl.lctrl_mon</code>, set by +lctrl_mon
<dd> local controller monitor;
<br>
Setting lctrl_mon to 1 enables logging of local controller
events into the simulation log.
<p>
<dt> <code>vsim.lctrl.button</code>, default 0x0000
<dd> buttons pressed, one bit per button;
<p>
<dt> <code>vsim.lctrl.xmove</code>, default 0
<dd> x stick move control;
<br>
negative values simulate stick move to the left, positive to the right;
<br>
set to 0 when motion simulation is finished;
<br>
can be set to values larger than the x counter limits
to test that the counter does not overflow;
<p>
<dt> <code>vsim.lctrl.ymove</code>, default 0
<dd> y stick move control;
<br>
negative values simulate stick move down, positive up;
<br>
set to 0 when motion simulation is finished;
<br>
can be set to values larger than the y counter limits
to test that the counter does not overflow;
<p>
<dt> <code>vsim.lctrl.inmotion</code>, default 0
<dd> busy with motion;
<br>
set as long as there is motion to simulate;
<br>
xmove and ymove can be overwritten at any time;
<p>
<dt> <code>vsim.lctrl.jitter</code>, default 0
<dd> random jitter mask;
<br>
mask applied to a 32-bit random;
<br>
the result is a time in ns that is added to the pulse timing values
to jitter the x/y motion pulses;
<p>
<dt> <code>vsim.lctrl.tLow</code>, default JCHAN_PERIOD * 4
<dd> inactive time between motion pulses;
<p>
<dt> <code>vsim.lctrl.tXfer</code>, default JCHAN_PERIOD * 4
<dd> lead/tail time between pulse signals;
<p>
<dt> <code>vsim.lctrl.tHigh</code>, default JCHAN_PERIOD * 4
<dd> active time of both pulse signals;
<p>
<dt> <code>vsim.lctrl.xglitch[1:0]</code>, default 0
<dd> x[1:0] glitch insertion;
<br>
set to one to cause a glitch on the respective x pulse signal;
<br>
clears itself after pulse has been sent out;
<p>
<dt> <code>vsim.lctrl.yglitch[1:0]</code>, default 0
<dd> y[1:0] glitch insertion;
<br> set to one to cause a glitch on the respective y pulse signal;
<br>
clears itself after pulse has been sent out;
</dl>
<p>
<b> JoyChannel Tests </b>
<p>
<dl>
<dt> J1. test SI_STATUS after reset;
<dd> all bits should be 0,
<dt> J2. test register bits;
<dd> test all read/write bits of all defined registers; SI_DRAM_ADDR,
SI_CONFIG, SI_CTRL; <br>
test SI_DRAM_ADDR address rounding, returns 0 for bits [2:0].
<dt> J3. test SI write DMA;
<dd> setup SI protocol buffers in memory; <br>
issue SI write DMA by writing SI_DMA_WRITE; <br>
check that dma is busy, DMA_BUSY=1; <br>
wait for dma completion or time out, DMA_BUSY=0; <br>
check that DMA_ERR is correct; <br>
check that interrupt flag is set, INT=1; <br>
check that SI interrupt is seen in MI; <br>
check data in SI buffers by reading them through PIO space; <br>
check that SI_STATUS is cleared after writing to it; <br>
<dt> J4. test SI read DMA;
<dd> a previous SI write DMA has moved protocol data to the SI; <br>
choose a memory different from the write DMA; <br>
issue SI read DMA by writing SI_DMA_READ; <br>
check that dma is busy, DMA_BUSY=1; <br>
the read dma triggers the communication to the the controllers; <br>
wait for dma completion or time out, DMA_BUSY=0; <br>
check that DMA_ERR is correct; <br>
check that interrupt flag is set, INT=1; <br>
check that SI interrupt is seen in MI; <br>
compare data in memory with SI buffers; <br>
check that SI_STATUS is cleared after writing to it; <br>
check that controller response is correct for the commands issued; <br>
<dt> J5. test DMA conflicts;
<dd> repeat test 4, but write SI_DRAM_ADDR, SI_DMA_WRITE or SI_DMA_READ
while the dma is busy; <br>
test 3 cannot be used, because write dma is done too quickly; <br>
the original DMA should complete; <br>
in addition, the DMA_ERR bit should be 1 to indicate conflict; <br>
<dt> J6. test controller bits;
<dd> repeat test 4 and/or 5; <br>
set bits through controller backdoor; <br>
check each type, status, button, x, and y bit in main memory;
<dt> J7. test controller errors;
<dd> set error modes in the JoyChannel controllers; <br>
force frame errors, collisions and no responses; <br>
check that the SI sets the appropriate error bits; <br>
<dt> J8. test all controller commands;
<dd> repeat tests J3 and J4 with all supported commands; <br>
check that response from controller is correct;
<dt> J9. test SI channel resets;
<dd> start a SI read DMA similar to test J4; <br>
write the SI_CTRL register with JCRST bit=1; <br>
the SI stops communication, the controller will time out; <br>
check that all controllers return no response; <br>
release JCRST bit=0; <br>
start another SI read DMA, which should complete normally;
<dt> J10. test single command errors
<dd> setup memory with byte 0 of controller 0 set to 0x00; <br>
start si write dma, followed by si read dma; <br>
check that 0xff is returned in the read dma data of all controllers; <br>
<dt> J11. random tests
<dd> repeat above tests with randoms for memory addresses, controller
status and responses,
</dl>
<hr>
<font size="-1">
Problems and comments to
<a href="mailto:berndt@broadon.com">
berndt@broadon.com
</a>
</font>
</body>
</html>