OpenCores

Subversion Repositories ha1588

[/] [ha1588/] [trunk/] [sim/] [top/] [ha1588_tb.v] - Blame information for rev 38

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

Line No. Rev Author Line
1 34 edn_walter
/*
2 38 edn_walter
 * ha1588_tb.v
3 34 edn_walter
 *
4 37 edn_walter
 * Copyright (c) 2012, BABY&HW. All rights reserved.
5 34 edn_walter
 *
6
 * This library is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * This library is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA 02110-1301  USA
20
 */
21
 
22 21 edn_walter
`timescale 1ns/1ns
23
 
24
module ha1588_tb ();
25
 
26
reg up_clk;
27
wire up_wr, up_rd;
28
wire [ 7:0] up_addr;
29
wire [31:0] up_data_wr, up_data_rd;
30
initial begin
31
             up_clk = 1'b0;
32
  forever #5 up_clk = !up_clk;
33
end
34
 
35
reg rtc_clk;
36
initial begin
37
             rtc_clk = 1'b0;
38
  forever #4 rtc_clk = !rtc_clk;
39
end
40
 
41
reg rst;
42
initial begin
43
      rst = 1'b1;
44
  #10 rst = 1'b0;
45
end
46
 
47 24 edn_walter
wire        rx_gmii_clk;
48
wire        rx_gmii_ctrl;
49
wire [ 7:0] rx_gmii_data;
50
wire        tx_gmii_clk;
51
wire        tx_gmii_ctrl;
52
wire [ 7:0] tx_gmii_data;
53
 
54
gmii_rx_bfm NIC_DRV_RX_BFM (
55
  .gmii_rxclk(rx_gmii_clk),
56
  .gmii_rxctrl(rx_gmii_ctrl),
57
  .gmii_rxdata(rx_gmii_data)
58
);
59
 
60
gmii_tx_bfm NIC_DRV_TX_BFM (
61
  .gmii_txclk(tx_gmii_clk),
62
  .gmii_txctrl(tx_gmii_ctrl),
63
  .gmii_txdata(tx_gmii_data)
64
);
65
 
66 21 edn_walter
ptp_drv_bfm_sv PTP_DRV_BFM (
67
  .up_clk(up_clk),
68
  .up_wr(up_wr),
69
  .up_rd(up_rd),
70
  .up_addr(up_addr),
71
  .up_data_wr(up_data_wr),
72
  .up_data_rd(up_data_rd)
73
);
74
 
75 24 edn_walter
ha1588 PTP_HA_DUT (
76 21 edn_walter
  .rst(rst),
77
  .clk(up_clk),
78
  .wr_in(up_wr),
79
  .rd_in(up_rd),
80
  .addr_in(up_addr),
81
  .data_in(up_data_wr),
82
  .data_out(up_data_rd),
83
 
84
  .rtc_clk(rtc_clk),
85 32 edn_walter
  .rtc_time_ptp_ns(),
86
  .rtc_time_ptp_sec(),
87 21 edn_walter
 
88 24 edn_walter
  .rx_gmii_clk(rx_gmii_clk),
89
  .rx_gmii_ctrl(rx_gmii_ctrl),
90
  .rx_gmii_data(rx_gmii_data),
91
  .tx_gmii_clk(tx_gmii_clk),
92
  .tx_gmii_ctrl(tx_gmii_ctrl),
93
  .tx_gmii_data(tx_gmii_data)
94 21 edn_walter
);
95
 
96
initial begin
97
        ha1588_tb.PTP_DRV_BFM.up_start = 1;
98
        #100000000 $stop;
99
end
100
 
101
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2014 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.