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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [logic/] [ip/] [ps2_interface/] [sim/] [icarus/] [default/] [test_define] - Blame information for rev 131

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
 
2
 
3
 
4
initial
5
 begin
6
 $display("              ");
7
 $display("          ===================================================");
8
 $display("%8d  Test Start",$realtime );
9
 $display("          ===================================================");
10
 $display("              ");
11
 
12
 
13
 fork
14
 begin
15
 test.cg.next(12);
16
 
17
 test.cg.next(1000);
18
 
19
// test host to device
20
 test.ps2_host.send_byte   (8'h00);
21
 test.cg.next(10);
22
 
23
 test.ps2_host.send_byte   (8'h81);
24
 test.cg.next(10);
25
 
26
 test.ps2_host.send_byte   (8'h74);
27
 test.cg.next(10);
28
 
29
 test.ps2_host.send_byte   (8'hf7);
30
 test.cg.next(10);
31
 
32
 // test host to device no ack
33
 test.ps2_model.device_ack            = 1'b0;
34
 test.ps2_host.exp_tx_ack_err          = 1'b1;
35
 test.ps2_host.send_byte   (8'hff);
36
 test.cg.next(10);
37
 
38
 // test host to device with ack
39
 test.ps2_model.device_ack            = 1'b1;
40
 test.ps2_host.exp_tx_ack_err          = 1'b0;
41
 test.ps2_host.send_byte   (8'haa);
42
 test.cg.next(1000);
43
 
44
 
45
 // test device to host
46
 test.ps2_host.clear_rx_host;
47
 test.ps2_host.rcv_byte(8'h00);
48
 test.cg.next(100);
49
 
50
 
51
 test.ps2_host.clear_rx_host;
52
 test.ps2_host.rcv_byte(8'h81);
53
 test.cg.next(100);
54
 
55
 test.ps2_host.clear_rx_host;
56
 test.ps2_host.rcv_byte(8'h7e);
57
 test.cg.next(100);
58
 
59
 test.ps2_host.clear_rx_host;
60
 test.ps2_host.rcv_byte(8'hff);
61
 test.cg.next(100);
62
 
63
 //  parity error
64
 test.ps2_host.clear_rx_host;
65
 test.ps2_host.rcv_byte(8'haa);
66
 test.cg.next(100);
67
 
68
 //  framing error
69
 
70
 test.ps2_host.clear_rx_host;
71
 test.ps2_host.rcv_byte(8'h55);
72
 test.cg.next(100);
73
 end
74
 
75
 
76
  begin
77
  test.cg.next(12);
78
  test.ps2_model.rcv_byte(8'h00,1'b1);
79
  test.ps2_model.rcv_byte(8'h81,1'b1);
80
  test.ps2_model.rcv_byte(8'h74,1'b1);
81
  test.ps2_model.rcv_byte(8'hf7,1'b0);
82
  test.ps2_model.rcv_byte(8'hff,1'b1);
83
  test.ps2_model.rcv_byte(8'haa,1'b1);
84
  test.cg.next(10000);
85
  test.ps2_model.device_tx_parity = 1'b0;
86
  test.ps2_model.send_byte(8'h00);
87
  test.cg.next(100);
88
  test.ps2_model.send_byte(8'h81);
89
  test.cg.next(100);
90
  test.ps2_model.send_byte(8'h7e);
91
  test.cg.next(100);
92
  test.ps2_model.send_byte(8'hff);
93
  test.cg.next(100);
94
  test.ps2_model.device_tx_parity = 1'b1;
95
  test.ps2_model.send_byte(8'haa);
96
  test.cg.next(100);
97
  test.ps2_model.device_tx_parity = 1'b0;
98
  test.ps2_model.device_stop    = 1'b0;
99
  test.ps2_model.send_byte(8'h55);
100
 
101
  end
102
  join
103
 
104
 test.cg.exit;
105
end
106
 
107
 
108
 
109
 

powered by: WebSVN 2.1.0

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