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

Subversion Repositories ha1588

[/] [ha1588/] [trunk/] [rtl/] [top/] [ha1588.v] - Blame information for rev 37

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

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

powered by: WebSVN 2.1.0

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