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

Subversion Repositories usb2uart

[/] [usb2uart/] [trunk/] [verify/] [tests/] [usb_test1.v] - Blame information for rev 8

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

Line No. Rev Author Line
1 3 dinesha
`define usbbfm  tb.u_usb_agent.bfm_inst
2
task usb_test1;
3
 
4
reg [6:0] address;
5
reg [3:0] endpt;
6
reg [3:0] Status;
7
reg [31:0] ByteCount;
8
 
9
integer    i,j;
10
reg [7:0]  startbyte;
11
reg [15:0] mask;
12
integer    MaxPktSize;
13
reg [3:0]  PackType;
14
 
15
 
16
parameter  MYACK   = 4'b0000,
17
           MYNAK   = 4'b0001,
18
           MYSTALL = 4'b0010,
19
           MYTOUT  = 4'b0011,
20
           MYIVRES = 4'b0100,
21
           MYCRCER = 4'b0101;
22
 
23
 
24
 
25
     begin
26
 
27
 
28
    $display("%0d: USB Reset  -----", $time);
29
    tb.u_usb_agent.bfm_inst.usb_reset(48);
30
 
31
    address = 1;
32
    endpt    = 0;
33
    $display("%0d: Set Address = %x -----", $time,address);
34
    `usbbfm.SetAddress (address);
35
    $display("%0d: Sending Setup Command ", $time);
36
    `usbbfm.setup(7'h00, 4'h0, Status);
37
    `usbbfm.printstatus(Status, MYACK);
38
    $display("%0d: Sending Status Command ", $time);
39
    `usbbfm.status_IN(7'h00, endpt, Status);
40
    `usbbfm.printstatus(Status, MYACK);
41
    #5000;
42
 
43
    $display("%0d: Set configuration  -----", $time);
44
    `usbbfm.SetConfiguration(2'b01);
45
    `usbbfm.setup(address, 4'b0000, Status);
46
    `usbbfm.printstatus(Status, MYACK);
47
    `usbbfm.status_IN(address, 4'b0000, Status);
48
    `usbbfm.printstatus(Status, MYACK);
49
    #2000;
50
 
51
    $display("%0d: Configuration done !!!!!!", $time);
52
    tb.test_control.finish_test;
53
 
54
  end
55
 
56
endtask

powered by: WebSVN 2.1.0

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