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

Subversion Repositories ha1588

[/] [ha1588/] [trunk/] [rtl/] [top/] [ha1588.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.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 18 edn_walter
`timescale 1ns/1ns
23
 
24
module ha1588 (
25
  input         rst,clk,
26
  input         wr_in,rd_in,
27 21 edn_walter
  input  [ 7:0] addr_in,
28 18 edn_walter
  input  [31:0] data_in,
29
  output [31:0] data_out,
30
 
31 32 edn_walter
  input         rtc_clk,
32
  output [31:0] rtc_time_ptp_ns,
33
  output [47:0] rtc_time_ptp_sec,
34 18 edn_walter
 
35
  input       rx_gmii_clk,
36
  input       rx_gmii_ctrl,
37
  input [7:0] rx_gmii_data,
38
  input       tx_gmii_clk,
39
  input       tx_gmii_ctrl,
40
  input [7:0] tx_gmii_data
41
);
42
 
43
wire rtc_rst;
44
wire rtc_time_ld, rtc_period_ld, rtc_adj_ld;
45
wire [37:0] rtc_time_reg_ns;
46
wire [47:0] rtc_time_reg_sec;
47
wire [39:0] rtc_period;
48
wire [31:0] rtc_adj_ld_data;
49
wire [39:0] rtc_period_adj;
50
wire [37:0] rtc_time_reg_ns_val;
51
wire [47:0] rtc_time_reg_sec_val;
52 32 edn_walter
wire [79:0] rtc_time_ptp_val = {rtc_time_ptp_sec[47:0], rtc_time_ptp_ns[31:0]};
53 18 edn_walter
 
54
wire rx_q_rst, rx_q_clk;
55
wire rx_q_rd_en;
56 37 edn_walter
wire [  7:0] rx_q_stat;
57
wire [127:0] rx_q_data;
58 18 edn_walter
wire tx_q_rst, tx_q_clk;
59
wire tx_q_rd_en;
60 37 edn_walter
wire [  7:0] tx_q_stat;
61
wire [127:0] tx_q_data;
62 18 edn_walter
 
63
rgs u_rgs
64
(
65
  .rst(rst),
66
  .clk(clk),
67
  .wr_in(wr_in),
68
  .rd_in(rd_in),
69
  .addr_in(addr_in),
70
  .data_in(data_in),
71
  .data_out(data_out),
72
  .rtc_clk_in(rtc_clk),
73
  .rtc_rst_out(rtc_rst),
74
  .time_ld_out(rtc_time_ld),
75
  .time_reg_ns_out(rtc_time_reg_ns),
76
  .time_reg_sec_out(rtc_time_reg_sec),
77
  .period_ld_out(rtc_period_ld),
78
  .period_out(rtc_period),
79
  .adj_ld_out(rtc_adj_ld),
80
  .adj_ld_data_out(rtc_adj_ld_data),
81
  .period_adj_out(rtc_period_adj),
82 38 edn_walter
  .adj_ld_done_in(adj_ld_done),
83 18 edn_walter
  .time_reg_ns_in(rtc_time_reg_ns_val),
84
  .time_reg_sec_in(rtc_time_reg_sec_val),
85
  .rx_q_rst_out(rx_q_rst),
86
  .rx_q_rd_clk_out(rx_q_clk),
87
  .rx_q_rd_en_out(rx_q_rd_en),
88
  .rx_q_stat_in(rx_q_stat),
89
  .rx_q_data_in(rx_q_data),
90
  .tx_q_rst_out(tx_q_rst),
91
  .tx_q_rd_clk_out(tx_q_clk),
92
  .tx_q_rd_en_out(tx_q_rd_en),
93
  .tx_q_stat_in(tx_q_stat),
94
  .tx_q_data_in(tx_q_data)
95
);
96
 
97
rtc u_rtc
98
(
99
  .rst(rtc_rst),
100
  .clk(rtc_clk),
101
  .time_ld(rtc_time_ld),
102
  .time_reg_ns_in(rtc_time_reg_ns),
103
  .time_reg_sec_in(rtc_time_reg_sec),
104
  .period_ld(rtc_period_ld),
105
  .period_in(rtc_period),
106
  .adj_ld(rtc_adj_ld),
107
  .adj_ld_data(rtc_adj_ld_data),
108 38 edn_walter
  .adj_ld_done(adj_ld_done),
109 18 edn_walter
  .period_adj(rtc_period_adj),
110
  .time_reg_ns(rtc_time_reg_ns_val),
111 32 edn_walter
  .time_reg_sec(rtc_time_reg_sec_val),
112
  .time_ptp_ns(rtc_time_ptp_ns),
113
  .time_ptp_sec(rtc_time_ptp_sec)
114 18 edn_walter
);
115
 
116
tsu u_rx_tsu
117
(
118
  .rst(rst),
119
  .gmii_clk(rx_gmii_clk),
120
  .gmii_ctrl(rx_gmii_ctrl),
121
  .gmii_data(rx_gmii_data),
122
  .rtc_timer_clk(rtc_clk),
123 32 edn_walter
  .rtc_timer_in(rtc_time_ptp_val),
124 18 edn_walter
  .q_rst(rx_q_rst),
125
  .q_rd_clk(rx_q_clk),
126
  .q_rd_en(rx_q_rd_en),
127
  .q_rd_stat(rx_q_stat),
128
  .q_rd_data(rx_q_data)
129
);
130
 
131
tsu u_tx_tsu
132
(
133
  .rst(rst),
134
  .gmii_clk(tx_gmii_clk),
135
  .gmii_ctrl(tx_gmii_ctrl),
136
  .gmii_data(tx_gmii_data),
137
  .rtc_timer_clk(rtc_clk),
138 32 edn_walter
  .rtc_timer_in(rtc_time_ptp_val),
139 18 edn_walter
  .q_rst(tx_q_rst),
140
  .q_rd_clk(tx_q_clk),
141
  .q_rd_en(tx_q_rd_en),
142
  .q_rd_stat(tx_q_stat),
143
  .q_rd_data(tx_q_data)
144
);
145
 
146
endmodule

powered by: WebSVN 2.1.0

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