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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [adv_debug_sys/] [Hardware/] [adv_dbg_if/] [sim/] [icarus/] [jfifo_sync/] [test_define] - Blame information for rev 131

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

Line No. Rev Author Line
1 131 jt_eaton
reg actual;
2
reg [31:0] d;
3
 
4
parameter       EXTEST=4'b0000;
5
parameter       SAMPLE=4'b0001;
6
parameter       HIGHZ_MODE=4'b0010;
7
parameter       CHIP_ID_ACCESS=4'b0011;
8
parameter       CLAMP=4'b1000;
9
parameter       RPC_DATA=4'b1010;
10
parameter       RPC_ADD=4'b1001;
11
parameter       BYPASS=4'b1111;
12
parameter       INST_RETURN=4'b1101;
13
 
14
initial
15
begin
16
$display("              ");
17
$display("              ===================================================");
18
$display("              Test Start");
19
$display("              ===================================================");
20
$display("              ");
21
test.cg.next(2);
22
test.jtag_model.enable_tclk;
23
test.cg.next(20);
24
fork
25
begin
26
test.cg.next(20);
27
test.mask_jsp_data_out = 8'hff;
28
test.cg.next(20);
29
 
30
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
31
test.mask_jsp_data_out = 8'h00;
32
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
33
test.exp_jsp_data_out = 8'hff;
34
test.mask_jsp_data_out = 8'hff;
35
 
36
 
37
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
38
test.mask_jsp_data_out = 8'h00;
39
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
40
test.exp_jsp_data_out = 8'h81;
41
test.mask_jsp_data_out = 8'hff;
42
 
43
 
44
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
45
test.mask_jsp_data_out = 8'h00;
46
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
47
test.exp_jsp_data_out = 8'h18;
48
test.mask_jsp_data_out = 8'hff;
49
 
50
 
51
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
52
test.mask_jsp_data_out = 8'h00;
53
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
54
test.exp_jsp_data_out = 8'hca;
55
test.mask_jsp_data_out = 8'hff;
56
 
57
 
58
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
59
test.mask_jsp_data_out = 8'h00;
60
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
61
test.exp_jsp_data_out = 8'h7e;
62
test.mask_jsp_data_out = 8'hff;
63
 
64
 
65
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
66
test.mask_jsp_data_out = 8'h00;
67
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
68
test.exp_jsp_data_out = 8'h99;
69
test.mask_jsp_data_out = 8'hff;
70
 
71
 
72
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
73
test.mask_jsp_data_out = 8'h00;
74
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
75
test.exp_jsp_data_out = 8'hcc;
76
test.mask_jsp_data_out = 8'hff;
77
 
78
 
79
while (test.biu_wr_strobe != 1'b1) test.cg.next(1);
80
test.mask_jsp_data_out = 8'h00;
81
while (test.biu_wr_strobe != 1'b0) test.cg.next(1);
82
test.exp_jsp_data_out = 8'h36;
83
test.mask_jsp_data_out = 8'hff;
84
 
85
 
86
end
87
 
88
 
89
 
90
begin
91
test.cg.next(20);
92
test.jtag_model.enable_trst_n;
93
test.jtag_model.enable_reset;
94
test.jtag_model.init;
95
test.cg.next(10);
96
test.jtag_model.LoadTapInst(EXTEST,INST_RETURN);
97
test.cg.next(100);
98
test.jtag_model.LoadTapInst(CLAMP,INST_RETURN);
99
 
100
test.cg.next(100);
101
test.jtag_model.LoadTapInst(CHIP_ID_ACCESS,INST_RETURN);
102
test.jtag_model.Shift_Cmp_32(32'ha5a5a5a5,32'h12345678);
103
 
104
 
105
test.cg.next(100);
106
test.jtag_model.LoadTapInst(RPC_ADD,INST_RETURN);
107
 
108
//Shift_Cmp_42(42'h38000000000,42'h00000000000);
109
 
110
test.cg.next(5000);
111
 
112
 
113
Shift_Cmp_42(42'b0_11001010_00011000_10000001_11111111_0100_00001       ,42'hx97a7b7c744);
114
Shift_Cmp_42(42'b0_00110110_11001100_10011001_01111110_0100_00001       ,42'h00000000004);
115
 
116
 
117
test.cg.next(5000);
118
 
119
 
120
 
121
 
122
test.cg.next(100);
123
 
124
test.jtag_model.LoadTapInst(BYPASS,INST_RETURN);
125
 
126
test.cg.next(100);
127
end
128
 
129
 
130
begin
131
 
132
 
133
test.cg.next(1000);
134
 
135
 
136
fork
137
  begin
138
  test.jsp_data_in <= 8'hc7;
139
  test.jsp_data_in_stb <= 1'b1;
140
  test.cg.next(2);
141
  test.jsp_data_in_stb <= 1'b0;
142
  end
143
  begin
144
 
145
  test.cg.next(1);
146
  end
147
join
148
 
149
test.cg.next(30);
150
 
151
fork
152
  begin
153
  test.jsp_data_in <= 8'hb7;
154
  test.jsp_data_in_stb <= 1'b1;
155
  test.cg.next(2);
156
  test.jsp_data_in_stb <= 1'b0;
157
  end
158
  begin
159
 
160
  test.cg.next(1);
161
  end
162
join
163
 
164
test.cg.next(30);
165
 
166
 
167
fork
168
  begin
169
  test.jsp_data_in <= 8'ha7;
170
  test.jsp_data_in_stb <= 1'b1;
171
  test.cg.next(2);
172
  test.jsp_data_in_stb <= 1'b0;
173
  end
174
  begin
175
 
176
  test.cg.next(1);
177
  end
178
join
179
 
180
test.cg.next(30);
181
 
182
 
183
 
184
fork
185
  begin
186
  test.jsp_data_in <= 8'h97;
187
  test.jsp_data_in_stb <= 1'b1;
188
  test.cg.next(2);
189
  test.jsp_data_in_stb <= 1'b0;
190
  end
191
  begin
192
 
193
  test.cg.next(1);
194
  end
195
join
196
 
197
test.cg.next(30);
198
 
199
 
200
 
201
 
202
 
203
 
204
 
205
end
206
 
207
 
208
 
209
join
210
 
211
 
212
 
213
 
214
test.cg.exit;
215
end
216
 
217
 
218
 
219
 
220
 
221
task automatic  Shift_Cmp_42;    // Initialize boundary register with outputs disabled
222
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
223
 
224
  parameter [15:0] LENGTH =  42;
225
 
226
 
227
  input [LENGTH:1]  Dataout;
228
  input [LENGTH:1]  DataExp;
229
 
230
  integer i;
231
 
232
  reg [LENGTH:1]  DataBack;
233
 
234
  begin
235
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
236
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
237
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
238
    for (i = 1; i <= LENGTH; i = i+1)
239
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
240
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
241
 
242
   if (DataBack  !== DataExp )
243
   begin
244
   test.cg.fail  (" Shift_cmp  receive error  ");
245
   end
246
 
247
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
248
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
249
  end
250
endtask // ShiftRegister
251
 
252
 
253
 
254
 
255
task automatic  Shift_Cmp_25;    // Initialize boundary register with outputs disabled
256
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
257
 
258
  parameter [15:0] LENGTH =  25;
259
 
260
 
261
  input [LENGTH:1]  Dataout;
262
  input [LENGTH:1]  DataExp;
263
 
264
  integer i;
265
 
266
  reg [LENGTH:1]  DataBack;
267
 
268
  begin
269
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
270
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
271
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
272
    for (i = 1; i <= LENGTH; i = i+1)
273
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
274
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
275
 
276
   if (DataBack  !== DataExp )
277
   begin
278
   test.cg.fail  (" Shift_cmp  receive error  ");
279
   end
280
 
281
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
282
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
283
  end
284
endtask // ShiftRegister
285
 
286
 
287
 
288
 
289
task automatic  Shift_Cmp_34;    // Initialize boundary register with outputs disabled
290
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
291
 
292
  parameter [15:0] LENGTH =  34;
293
 
294
 
295
  input [LENGTH:1]  Dataout;
296
  input [LENGTH:1]  DataExp;
297
 
298
  integer i;
299
 
300
  reg [LENGTH:1]  DataBack;
301
 
302
  begin
303
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
304
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
305
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
306
    for (i = 1; i <= LENGTH; i = i+1)
307
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
308
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
309
 
310
   if (DataBack  !== DataExp )
311
   begin
312
   test.cg.fail  (" Shift_cmp  receive error  ");
313
   end
314
 
315
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
316
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
317
  end
318
endtask // ShiftRegister
319
 
320
 
321
 
322
 
323
 
324
task automatic  Shift_Cmp_26;    // Initialize boundary register with outputs disabled
325
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
326
 
327
  parameter [15:0] LENGTH =  26;
328
 
329
 
330
  input [LENGTH:1]  Dataout;
331
  input [LENGTH:1]  DataExp;
332
 
333
  integer i;
334
 
335
  reg [LENGTH:1]  DataBack;
336
 
337
  begin
338
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
339
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
340
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
341
    for (i = 1; i <= LENGTH; i = i+1)
342
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
343
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
344
 
345
   if (DataBack  !== DataExp )
346
   begin
347
   test.cg.fail  (" Shift_cmp  receive error  ");
348
   end
349
 
350
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
351
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
352
  end
353
endtask // ShiftRegister
354
 
355
 
356
 
357
 
358
 
359
 
360
task automatic  Shift_Cmp_17;    // Initialize boundary register with outputs disabled
361
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
362
 
363
  parameter [15:0] LENGTH =  17;
364
 
365
 
366
  input [LENGTH:1]  Dataout;
367
  input [LENGTH:1]  DataExp;
368
 
369
  integer i;
370
 
371
  reg [LENGTH:1]  DataBack;
372
 
373
  begin
374
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
375
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
376
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
377
    for (i = 1; i <= LENGTH; i = i+1)
378
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
379
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
380
 
381
   if (DataBack  !== DataExp )
382
   begin
383
   test.cg.fail  (" Shift_cmp  receive error  ");
384
   end
385
 
386
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
387
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
388
  end
389
endtask // ShiftRegister
390
 
391
 
392
 
393
 
394
task automatic  Shift_Cmp_9;    // Initialize boundary register with outputs disabled
395
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
396
 
397
  parameter [15:0] LENGTH =  9;
398
 
399
 
400
  input [LENGTH:1]  Dataout;
401
  input [LENGTH:1]  DataExp;
402
 
403
  integer i;
404
 
405
  reg [LENGTH:1]  DataBack;
406
 
407
  begin
408
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
409
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
410
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
411
    for (i = 1; i <= LENGTH; i = i+1)
412
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
413
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
414
 
415
   if (DataBack  !== DataExp )
416
   begin
417
   test.cg.fail  (" Shift_cmp  receive error  ");
418
   end
419
 
420
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
421
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
422
  end
423
endtask // ShiftRegister
424
 
425
 
426
 
427
 
428
 
429
 
430
 

powered by: WebSVN 2.1.0

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