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

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [soc/] [bench/] [models/] [28f016s3/] [test_bad.v] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 xianfeng
/*
2
 INTEL DEVELOPER'S SOFTWARE LICENSE AGREEMENT
3
 
4
BY USING THIS SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF
5
THIS AGREEMENT.  DO NOT USE THE SOFTWARE UNTIL YOU HAVE CAREFULLY READ
6
AND AGREED TO THE FOLLOWING TERMS AND CONDITIONS.  IF YOU DO NOT AGREE
7
TO THE TERMS OF THIS AGREEMENT, PROMPTLY RETURN THE SOFTWARE PACKAGE AND
8
ANY ACCOMPANYING ITEMS.
9
 
10
IF YOU USE THIS SOFTWARE, YOU WILL BE BOUND BY THE TERMS OF THIS
11
AGREEMENT
12
 
13
LICENSE: Intel Corporation ("Intel") grants you the non-exclusive right
14
to use the enclosed software program ("Software").  You will not use,
15
copy, modify, rent, sell or transfer the Software or any portion
16
thereof, except as provided in this Agreement.
17
 
18
System OEM Developers may:
19
1.      Copy the Software for support, backup or archival purposes;
20
2.      Install, use, or distribute Intel owned Software in object code
21
        only;
22
3.      Modify and/or use Software source code that Intel directly makes
23
        available to you as an OEM Developer;
24
4.      Install, use, modify, distribute, and/or make or have made
25
        derivatives ("Derivatives") of Intel owned Software under the
26
        terms and conditions in this Agreement, ONLY if you are a System
27
        OEM Developer and NOT an end-user.
28
 
29
RESTRICTIONS:
30
 
31
YOU WILL NOT:
32
1.      Copy the Software, in whole or in part, except as provided for
33
        in this Agreement;
34
2.      Decompile or reverse engineer any Software provided in object
35
        code format;
36
3.      Distribute any Software or Derivative code to any end-users,
37
        unless approved by Intel in a prior writing.
38
 
39
TRANSFER: You may transfer the Software to another OEM Developer if the
40
receiving party agrees to the terms of this Agreement at the sole risk
41
of any receiving party.
42
 
43
OWNERSHIP AND COPYRIGHT OF SOFTWARE: Title to the Software and all
44
copies thereof remain with Intel or its vendors.  The Software is
45
copyrighted and is protected by United States and international
46
copyright laws.  You will not remove the copyright notice from the
47
Software.  You agree to prevent any unauthorized copying of the
48
Software.
49
 
50
DERIVATIVE WORK: OEM Developers that make or have made Derivatives will
51
not be required to provide Intel with a copy of the source or object
52
code.  OEM Developers shall be authorized to use, market, sell, and/or
53
distribute Derivatives to other OEM Developers at their own risk and
54
expense. Title to Derivatives and all copies thereof shall be in the
55
particular OEM Developer creating the Derivative.  Such OEMs shall
56
remove the Intel copyright notice from all Derivatives if such notice is
57
contained in the Software source code.
58
 
59
DUAL MEDIA SOFTWARE: If the Software package contains multiple media,
60
you may only use the medium appropriate for your system.
61
 
62
WARRANTY: Intel warrants that it has the right to license you to use,
63
modify, or distribute the Software as provided in this Agreement. The
64
Software is provided "AS IS".  Intel makes no representations to
65
upgrade, maintain, or support the Software at any time. Intel warrants
66
that the media on which the Software is furnished will be free from
67
defects in material and workmanship for a period of one (1) year from
68
the date of purchase.  Upon return of such defective media, Intel's
69
entire liability and your exclusive remedy shall be the replacement of
70
the Software.
71
 
72
THE ABOVE WARRANTIES ARE THE ONLY WARRANTIES OF ANY KIND, EITHER EXPRESS
73
OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
74
PARTICULAR PURPOSE.
75
 
76
LIMITATION OF LIABILITY: NEITHER INTEL NOR ITS VENDORS OR AGENTS SHALL
77
BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA,
78
INTERRUPTION OF BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR
79
CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER THIS AGREEMENT OR
80
OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
81
 
82
TERMINATION OF THIS LICENSE: Intel reserves the right to conduct or have
83
conducted audits to verify your compliance with this Agreement.  Intel
84
may terminate this Agreement at any time if you are in breach of any of
85
its terms and conditions.  Upon termination, you will immediately
86
destroy, and certify in writing the destruction of, the Software or
87
return all copies of the Software and documentation to Intel.
88
 
89
U.S. GOVERNMENT RESTRICTED RIGHTS: The Software and documentation were
90
developed at private expense and are provided with "RESTRICTED RIGHTS".
91
Use, duplication or disclosure by the Government is subject to
92
restrictions as set forth in FAR52.227-14 and DFAR252.227-7013 et seq.
93
or its successor.
94
 
95
EXPORT LAWS: You agree that the distribution and export/re-export of the
96
Software is in compliance with the laws, regulations, orders or other
97
restrictions of the U.S. Export Administration Regulations.
98
 
99
APPLICABLE LAW: This Agreement is governed by the laws of the State of
100
California and the United States, including patent and copyright laws.
101
Any claim arising out of this Agreement will be brought in Santa Clara
102
County, California.
103
 
104
*/
105
 
106
 
107
`timescale   1ns/1ns
108
 
109
 
110
module test28F016SC();
111
 
112
reg [`AddrSize-1:0]  address;
113
 
114
reg [31:0]  vcc,
115
            vpp;
116
 
117
reg         ceb,
118
            oeb,
119
            web,
120
            rpb;
121
 
122
wire        ryby;
123
 
124
reg [1:0]   rpblevel;    // 00 = VIL
125
                         // 01 = VIH
126
                         // 10 = VHH
127
 
128
reg    [`MaxOutputs-1:0]  dq_reg;
129
wire   [`MaxOutputs-1:0]  dq = dq_reg;
130
 
131
IntelSVFF IFlash (dq, address, ceb, oeb, web, rpb, ryby, vpp, vcc, rpblevel);
132
 
133
initial
134
    begin
135
//        $dumpfile("f008sc.dmp");
136
//        $dumpoff;
137
//        $dumpvars(???,dq,address,ceb,oeb,web,rpb);
138
 
139
       dq_reg = `MaxOutputs'hz;
140
       rpblevel = `rpb_vil;
141
       powerup;
142
       ReadID;
143
       #100
144
       oeb = `VIH;
145
 
146
       ProgramData(`AddrSize'h2FFFF, `MaxOutputs'hAA);
147
       ProgramData(`AddrSize'h60000, `MaxOutputs'h06);
148
 
149
       begin:  WriteTest
150
         $display("rdARRAY DURING WRITE TEST");
151
         #100
152
         StartProgram(`AddrSize'h00000, `MaxOutputs'h00);
153
         #150
154
         oeb = `VIH;
155
         #100
156
         oeb = `VIL;
157
         #100
158
         oeb = `VIH;
159
         #(((`AC_ProgramTime_Byte_50_12/2)*`TimerPeriod_)-1000)
160
         SetReadMode;
161
         #100
162
         ReadData(`AddrSize'h2FFFF);
163
         #100
164
         oeb = `VIH;
165
         #100
166
         oeb = `VIL;
167
         #((`AC_ProgramTime_Byte_50_12/2)*`TimerPeriod_)
168
         begin: Poll
169
           forever
170
             begin
171
               oeb = `VIH;
172
               #500
173
               oeb = `VIL;
174
               #500
175
               if (dq[7] == `VIH)
176
                 disable Poll;
177
             end
178
         end
179
         #300
180
         SetReadMode;
181
         #100
182
         ReadData(`AddrSize'h00000);
183
         #100
184
         ReadData(`AddrSize'h2FFFF);
185
         #100
186
         oeb = `VIH;
187
       end  //WriteTest
188
 
189
       begin:  WriteSuspend
190
         $display("WRITE SUSPEND TEST");
191
         #100
192
         StartProgram(`AddrSize'h10000, `MaxOutputs'h01);
193
         #150
194
         oeb = `VIH;
195
         #100
196
         oeb = `VIL;
197
         #100
198
         oeb = `VIH;
199
         #(((`AC_ProgramTime_Byte_50_12/2)*`TimerPeriod_)-1000)
200
         Suspend;
201
         #100
202
         ClearCSRMode;
203
         #100
204
         ReadCSRMode;
205
         #100
206
         oeb = `VIH;
207
         #300
208
         Resume;
209
         #100
210
         oeb = `VIL;
211
         #((`AC_ProgramTime_Byte_50_12/2)*`TimerPeriod_)
212
         begin: Poll
213
           forever
214
             begin
215
               oeb = `VIH;
216
               #500
217
               oeb = `VIL;
218
               #500
219
               if (dq[7] == `VIH)
220
                 disable Poll;
221
             end
222
         end
223
         #300
224
         SetReadMode;
225
         #100
226
         ReadData(`AddrSize'h10000);
227
         #100
228
         oeb = `VIH;
229
       end  //WriteSuspend
230
 
231
       $display("SET BLOCK LOCK-BITS");
232
       #100
233
       SetBlockLockBit(`AddrSize'h75000);
234
       #100
235
       oeb = `VIH;
236
 
237
       $display("ERASE BLOCK");
238
       #100
239
       EraseBlock(`AddrSize'h7000F);
240
 
241
       $display("READ DATA, Loose Timing, Toggle Addr");
242
       #100
243
       SetReadMode;
244
       #100
245
       oeb = `VIL;
246
       #100
247
       address = `AddrSize'h70000;
248
       #100
249
       address = `AddrSize'h7FFFF;
250
       #100
251
       oeb = `VIH;
252
 
253
       begin: BadErase
254
         $display("BAD ERASE TEST");
255
         #100
256
         address = `AddrSize'h60000;
257
         #100
258
         dq_reg = `EraseBlockCmd;
259
         #100
260
         web = `VIL;
261
         #100
262
         web = `VIH;
263
         #100
264
         dq_reg = `ReadArrayCmd;
265
         #100
266
         web = `VIL;
267
         #100
268
         web = `VIH;
269
         #100
270
         dq_reg = `MaxOutputs'hz;
271
         #100
272
         oeb = `VIL;
273
         #1000
274
         begin: Poll
275
           forever
276
             begin
277
               oeb = `VIH;
278
               #1000
279
               oeb = `VIL;
280
               #1000
281
               if (dq[7] == `VIH)
282
                 disable Poll;
283
             end
284
         end
285
       end //BadErase
286
       #200
287
       ReadCSRMode;
288
       #200
289
       ClearCSRMode;
290
       #200
291
       ReadCSRMode;
292
       #200
293
       SetReadMode;
294
       #100
295
       ReadData(`AddrSize'h60000);
296
       #100
297
       oeb = `VIH;
298
 
299
       begin : BadLockBit
300
         $display("BAD LOCK-BIT SEQUENCE TEST");
301
         #100
302
         address = `AddrSize'h40000;
303
         #100
304
         dq_reg = `LBSetupCmd;
305
         #100
306
         web = `VIL;
307
         #100
308
         web = `VIH;
309
         #100
310
         dq_reg = `MaxOutputs'h55;
311
         #100
312
         web = `VIL;
313
         #100
314
         web = `VIH;
315
         #100
316
         dq_reg = `MaxOutputs'hz;
317
         #100
318
         oeb = `VIL;
319
         #((`AC_Set_LockBit_50_12*`TimerPeriod_)-5000);
320
         begin : Poll
321
           forever
322
             begin
323
               oeb = `VIH;
324
               #1000
325
               oeb = `VIL;
326
               #1000
327
               if (dq[7] == `VIH)
328
                 disable Poll;
329
             end //forever
330
         end //Poll
331
         #300
332
         ClearCSRMode;
333
       end
334
 
335
       $display("LOW Vpp OPERATION TEST");
336
       #100
337
       vpp =1300;
338
       #100
339
       ProgramData(`AddrSize'h33333, `MaxOutputs'h33);
340
       #100
341
       EraseBlock(`AddrSize'h6F000);
342
       #100
343
       vpp = 12000;
344
       #100
345
       SetReadMode;
346
       #100
347
       ReadData(`AddrSize'h33333);
348
       #100
349
       address = `AddrSize'h60000;
350
       #100
351
       oeb = `VIH;
352
 
353
       #1000
354
       powerdown;
355
       #1000 $finish;
356
    end
357
 
358
always @(dq or address or ceb or rpb or oeb or web or vcc or vpp or rpblevel)
359
  begin
360
    $display(
361
      "%d Addr = %h, Data = %h, CEb=%b, RPb=%b, OEb=%b, WEb=%d, vcc=%d, vpp = %d",
362
      $time, address, dq, ceb, rpb, oeb, web, vcc, vpp);
363
  end
364
 
365
task powerup;
366
  begin
367
    $display("  POWERUP TASK");
368
    rpb = `VIL;         //reset
369
    #100
370
    address = 0;
371
    #100
372
    web = `VIH;         //write enable high
373
    #100
374
    oeb = `VIH;         //output ts
375
    #100
376
    ceb = `VIH;         //disabled
377
    #100
378
    vcc = 5000;         //power up vcc
379
    #5000
380
    vpp = 12000;        //ramp up vpp
381
    #5000
382
    rpb = `VIH;         //out of reset
383
    rpblevel = `rpb_vih;
384
    #100
385
    oeb = `VIL;         //enable outputs
386
    #100
387
    ceb = `VIL;         //enable chip
388
  end
389
endtask
390
 
391
 
392
task powerdown;
393
  begin
394
    $display("  POWERDOWN TASK");
395
    address = 0;
396
    #100
397
    rpb = `VIL;     //reset
398
    #100
399
    oeb = `VIH;     //output ts
400
    #100
401
    web = `VIH;     //we high
402
    #100
403
    ceb = `VIH;     //disabled
404
    #100
405
    vpp = 0;        //power down vpp
406
    #5000
407
    vcc = 0;        //ramp down vcc
408
  end
409
endtask
410
 
411
 
412
task ReadData;
413
  input [`AddrSize-1:0] addr;
414
 
415
  begin
416
    $display("  READDATA TASK");
417
    oeb = `VIH;
418
    #100
419
    address = addr;
420
    #100
421
    oeb = `VIL;
422
  end
423
endtask
424
 
425
 
426
task SetReadMode;
427
  begin
428
    $display("  SETREADMODE TASK");
429
    oeb = `VIH;
430
    #100
431
    dq_reg[`Byte] = `ReadArrayCmd;
432
    #100
433
    web = `VIL;
434
    #100
435
    web = `VIH;
436
    #100
437
    dq_reg = `MaxOutputs'hz;
438
  end
439
endtask
440
 
441
 
442
task ReadID;
443
  begin
444
    $display("  READID TASK");
445
    oeb = `VIH;
446
    #100
447
    address = `AddrSize'h0;
448
    #100
449
    dq_reg[`Byte] = `ReadIDCmd;
450
    #100
451
    web = `VIL;
452
    #100
453
    web = `VIH;
454
    #100
455
    dq_reg = `MaxOutputs'hz;
456
    #100
457
    oeb = `VIL;
458
    #100
459
    address = `AddrSize'h1;
460
    #100
461
    address = `AddrSize'h3;
462
    #100
463
    address = `AddrSize'h2;
464
    #100
465
    address = `AddrSize'h10002;
466
  end
467
endtask
468
 
469
 
470
task ReadCSRMode;
471
  begin
472
    $display("  READCSR MODE TASK");
473
    oeb = `VIH;
474
    #100
475
    dq_reg[`Byte] = `ReadCSRCmd;
476
    #100
477
    web = `VIL;
478
    #100
479
    web = `VIH;
480
    #100
481
    dq_reg = `MaxOutputs'hz;
482
    #100
483
    oeb = `VIL;
484
  end
485
endtask
486
 
487
 
488
task ClearCSRMode;
489
  begin
490
    $display("  CLEARCSRMODE TASK");
491
    oeb = `VIH;
492
    #100
493
    dq_reg[`Byte] = `ClearCSRCmd;
494
    #100
495
    web = `VIL;
496
    #100
497
    web = `VIH;
498
    #100
499
    dq_reg = `MaxOutputs'hz;
500
  end
501
endtask
502
 
503
 
504
task StartProgram;
505
  input [`AddrSize-1:0] addr;
506
  input [`MaxOutputs-1:0] data;
507
  begin
508
    $display("  STARTPROGRAM TASK");
509
    #100
510
    address = addr;
511
    #100
512
    dq_reg[`Byte] = `Program2Cmd;
513
    #100
514
    web = `VIL;
515
    #100
516
    web = `VIH;
517
    #100
518
    dq_reg[`Byte] = data;
519
    #100
520
    web = `VIL;
521
    #100
522
    web = `VIH;
523
    #100
524
    dq_reg = `MaxOutputs'hz;
525
  end
526
endtask
527
 
528
 
529
task ProgramData;
530
  input [`AddrSize-1:0] addr;
531
  input [`MaxOutputs-1:0] data;
532
  begin
533
    $display("  PROGRAMDATA TASK");
534
    StartProgram(addr, data);
535
    #100
536
    oeb = `VIL;
537
    #((`AC_ProgramTime_Byte_50_12*`TimerPeriod_)-500)
538
    begin:  Poll
539
      forever
540
        begin
541
          oeb = `VIH;
542
          #100
543
          oeb = `VIL;
544
          #100
545
          if (dq[7] == `VIH)
546
            disable Poll;
547
        end //forever
548
    end //Poll
549
    #300
550
    ClearCSRMode;
551
  end
552
endtask
553
 
554
 
555
task StartProgram2;
556
  input [`AddrSize-1:0] addr;
557
  input [`MaxOutputs-1:0] data;
558
  begin
559
    $display("  STARTPROGRAM2 TASK");
560
    #100
561
    address = addr;
562
    #100
563
    dq_reg[`Byte] = `Program2Cmd;
564
    #100
565
    web = `VIL;
566
    #5
567
    ceb = `VIL;
568
    #100
569
    ceb = `VIH;
570
    #5
571
    web = `VIH;
572
    #100
573
    dq_reg[`Byte] = data;
574
    #100
575
    web = `VIL;
576
    #5
577
    ceb = `VIL;
578
    #100
579
    ceb = `VIH;
580
    #5
581
    web = `VIH;
582
    #100
583
    ceb = `VIL;
584
    dq_reg = `MaxOutputs'hz;
585
  end
586
endtask
587
 
588
 
589
task ProgramData2;
590
  input [`AddrSize-1:0] addr;
591
  input [`MaxOutputs-1:0] data;
592
  begin
593
    $display("  PROGRAMDATA2 TASK");
594
    ceb = `VIH;
595
    StartProgram2(addr, data);
596
    #100
597
    oeb = `VIL;
598
    #((`AC_ProgramTime_Byte_50_12*`TimerPeriod_)-500)
599
    begin:  Poll
600
      forever
601
        begin
602
          oeb = `VIH;
603
          #100
604
          oeb = `VIL;
605
          #100
606
          if (dq[7] == `VIH)
607
            disable Poll;
608
        end //forever
609
    end //Poll
610
    #300
611
    ClearCSRMode;
612
  end
613
endtask
614
 
615
task StartErase;
616
  input [`AddrSize-1:0] BlockAddr;
617
  begin
618
    $display("  STARTERASE TASK");
619
    #100
620
    address = BlockAddr;
621
    #100
622
    dq_reg = `EraseBlockCmd;
623
    #100
624
    web = `VIL;
625
    #100
626
    web = `VIH;
627
    #100
628
    dq_reg = `ConfirmCmd;
629
    #100
630
    web = `VIL;
631
    #100
632
    web = `VIH;
633
    #100
634
    dq_reg = `MaxOutputs'hz;
635
  end
636
endtask
637
 
638
 
639
task EraseBlock;
640
  input [`AddrSize-1:0] BlockAddr;
641
  time EraseTime;
642
  begin
643
    $display("  ERASEBLOCK TASK");
644
    StartErase(BlockAddr);
645
    #100
646
    oeb = `VIL;
647
    EraseTime = ((`AC_EraseTime_Block_50_12*`TimerPeriod_)-5000);
648
    #EraseTime
649
    begin: Poll
650
      forever
651
        begin
652
          oeb = `VIH;
653
          #1000
654
          oeb = `VIL;
655
          #1000
656
          if (dq[7] == `VIH)
657
            disable Poll;
658
        end
659
    end
660
    #300
661
    ClearCSRMode;
662
  end
663
endtask
664
 
665
 
666
task StartLockBit;
667
  input [`AddrSize-1:0] BlockAddr;
668
  begin
669
    $display("  STARTLOCKBIT TASK");
670
    #100
671
    address = BlockAddr;
672
    #100
673
    dq_reg = `LBSetupCmd;
674
    #100
675
    web = `VIL;
676
    #100
677
    web = `VIH;
678
    #100
679
    dq_reg = `SetBlockLBCmd;
680
    #100
681
    web = `VIL;
682
    #100
683
    web = `VIH;
684
    #100
685
    dq_reg = `MaxOutputs'hz;
686
  end
687
endtask
688
 
689
 
690
task SetBlockLockBit;
691
  input [`AddrSize-1:0] BlockAddr;
692
  time LockBitTime;
693
  begin
694
    $display("  SETBLOCKLOCKBIT TASK");
695
    StartLockBit(BlockAddr);
696
    #100
697
    oeb = `VIL;
698
    LockBitTime = ((`AC_Set_LockBit_50_12*`TimerPeriod_)-5000);
699
    #LockBitTime
700
    begin : Poll
701
      forever
702
        begin
703
          oeb = `VIH;
704
          #1000
705
          oeb = `VIL;
706
          #1000
707
          if (dq[7] == `VIH)
708
            disable Poll;
709
        end //forever
710
    end //Poll
711
    #300
712
    ClearCSRMode;
713
  end
714
endtask
715
 
716
 
717
task StartClearBit;
718
  begin
719
    $display("  STARTCLEARBIT TASK");
720
    #100
721
    dq_reg = `LBSetupCmd;
722
    #100
723
    web = `VIL;
724
    #100
725
    web = `VIH;
726
    #100
727
    dq_reg = `ClearLBCmd;
728
    #100
729
    web = `VIL;
730
    #100
731
    web = `VIH;
732
    #100
733
    dq_reg = `MaxOutputs'hz;
734
  end
735
endtask
736
 
737
 
738
task ClearBlockLockBit;
739
  time ClearBitTime;
740
  begin
741
    $display("  CLEARBLOCKLOCKBIT TASK");
742
    StartClearBit;
743
 
744
    #100
745
    oeb = `VIL;
746
    ClearBitTime = ((`AC_Clear_LockBit_50_12*`TimerPeriod_)-5000);
747
    #ClearBitTime
748
    begin : Poll
749
         forever
750
           begin
751
                oeb = `VIH;
752
                #1000
753
                oeb = `VIL;
754
                #1000
755
                if (dq[7] == `VIH)
756
                  disable Poll;
757
           end //forever
758
    end //Poll
759
    #300
760
    ClearCSRMode;
761
  end
762
endtask
763
 
764
 
765
task SetMasterLockBit;
766
  input [`AddrSize-1:0] DeviceAddr;
767
  time LockBitTime;
768
  begin
769
    $display("  SETMASTERLOCKBIT TASK");
770
    #100
771
    address = DeviceAddr;
772
    #100
773
    dq_reg = `LBSetupCmd;
774
    #100
775
    web = `VIL;
776
    #100
777
    web = `VIH;
778
    #100
779
    dq_reg = `SetMasterLBCmd;
780
    #100
781
    web = `VIL;
782
    #100
783
    web = `VIH;
784
    #100
785
    dq_reg = `MaxOutputs'hz;
786
    #100
787
    oeb = `VIL;
788
    LockBitTime = ((`AC_Set_LockBit_50_12*`TimerPeriod_)-5000);
789
    #LockBitTime
790
    begin : Poll
791
      forever
792
        begin
793
          oeb = `VIH;
794
          #1000
795
          oeb = `VIL;
796
          #1000
797
          if (dq[7] == `VIH)
798
            disable Poll;
799
        end //forever
800
    end //Poll
801
    #300
802
    ClearCSRMode;
803
  end
804
endtask
805
 
806
task Suspend;
807
  begin
808
    $display("  SUSPEND TASK");
809
    #100
810
    dq_reg = `SuspendCmd;
811
    #100
812
    web = `VIL;
813
    #100
814
    web = `VIH;
815
    #100
816
    dq_reg = `MaxOutputs'hz;
817
    #100
818
    oeb = `VIL;
819
    #500
820
    begin: Poll
821
      forever
822
        begin
823
          oeb = `VIH;
824
          #100
825
          oeb = `VIL;
826
          #100
827
          if (dq[7] == `VIH)
828
            disable Poll;
829
        end
830
    end
831
  end
832
endtask
833
 
834
 
835
task Resume;
836
  begin
837
    $display("  RESUME TASK");
838
    #100
839
    dq_reg = `ResumeCmd;
840
    #100
841
    web = `VIL;
842
    #100
843
    web = `VIH;
844
    #100
845
    dq_reg = `MaxOutputs'hz;
846
  end
847
endtask
848
 
849
endmodule

powered by: WebSVN 2.1.0

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