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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [common/] [opencores.org/] [Testbench/] [bfms/] [ps2_model/] [rtl/] [verilog/] [top.tasks] - Blame information for rev 131

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
 
2
 
3
 
4
 
5
 
6
 
7
 
8
initial
9
  begin
10
   device_write           <=  1'b0;
11
   device_tx_data         <=  8'h00;
12
   device_tx_parity       <=  1'b0;
13
   device_ack             <=  1'b1;
14
   device_stop            <=  1'b1;
15
 
16
   exp_device_rx_data     <=  8'h00;
17
   mask_device_rx_data    <=  8'h00;
18
   exp_device_rx_parity   <=  1'b0;
19
   mask_device_rx_parity  <=  1'b0;
20
 
21
  end
22
 
23
 
24
 
25
task next;
26
  input [31:0] num;
27
  repeat (num)       @ (posedge clk);
28
endtask
29
 
30
 
31
task send_byte;
32
  input [7:0] byte_out;
33
 
34
begin
35
  while(tap_state != IDLE) next(1);
36
  $display("%t %m      %2h parity  %b",$realtime ,byte_out,device_tx_parity  );
37
  device_tx_data  <= byte_out;
38
  next(1);
39
  device_write   <= 1'b1;
40
  next(1);
41
  device_write   <= 1'b0;
42
end
43
endtask // send_byte
44
 
45
 
46
 
47
 
48
 
49
 
50
task rcv_byte;
51
  input [7:0] byte_in;
52
  input        parity;
53
   begin
54
 
55
   exp_device_rx_data  <=  byte_in;
56
   exp_device_rx_parity   <=  parity;
57
 
58
   while(!device_rx_read)  next(1);
59
   $display("%t           checking    %h         %b",$realtime,byte_in,parity);
60
   mask_device_rx_data <=  8'hff;
61
   mask_device_rx_parity  <=  1'b1;
62
   next(1);
63
 
64
   mask_device_rx_data <=  8'h00;
65
   mask_device_rx_parity  <=  1'b0;
66
 
67
 
68
end
69
endtask
70
 
71
 
72
always@(posedge clk)
73
  if( device_rx_read)
74
  $display ("%t %m device  rec    %h parity  %b",$realtime,device_rx_data,device_rx_parity);
75
 
76
always@(posedge clk)
77
  if(device_write)
78
  $display ("%t %m device send    %h parity  %b  stop %b ",$realtime,device_tx_data,device_tx_parity,device_stop);
79
 
80
 
81
 
82
 

powered by: WebSVN 2.1.0

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