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

Subversion Repositories ethernet_tri_mode

[/] [ethernet_tri_mode/] [trunk/] [rtl/] [verilog/] [Clk_ctrl.v] - Blame information for rev 5

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

Line No. Rev Author Line
1 5 maverickis
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Clk_ctrl.v                                                  ////
4
////                                                              ////
5
////  This file is part of the Ethernet IP core project           ////
6
////  http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - Jon Gao (gaojon@yahoo.com)                            ////
10
////                                                              ////
11
////                                                              ////
12
//////////////////////////////////////////////////////////////////////
13
////                                                              ////
14
//// Copyright (C) 2001 Authors                                   ////
15
////                                                              ////
16
//// This source file may be used and distributed without         ////
17
//// restriction provided that this copyright statement is not    ////
18
//// removed from the file and that any derivative work contains  ////
19
//// the original copyright notice and the associated disclaimer. ////
20
////                                                              ////
21
//// This source file is free software; you can redistribute it   ////
22
//// and/or modify it under the terms of the GNU Lesser General   ////
23
//// Public License as published by the Free Software Foundation; ////
24
//// either version 2.1 of the License, or (at your option) any   ////
25
//// later version.                                               ////
26
////                                                              ////
27
//// This source is distributed in the hope that it will be       ////
28
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
29
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
30
//// PURPOSE.  See the GNU Lesser General Public License for more ////
31
//// details.                                                     ////
32
////                                                              ////
33
//// You should have received a copy of the GNU Lesser General    ////
34
//// Public License along with this source; if not, download it   ////
35
//// from http://www.opencores.org/lgpl.shtml                     ////
36
////                                                              ////
37
//////////////////////////////////////////////////////////////////////
38
//                                                                    
39
// CVS Revision History                                               
40
//                                                                    
41
// $Log: not supported by cvs2svn $ 
42
 
43
module Clk_ctrl(
44
Reset                   ,
45
Clk_125M                ,
46
//host interface,
47
Speed                   ,
48
//Phy interface ,
49
Gtx_clk                 ,
50
Rx_clk                  ,
51
Tx_clk                  ,
52
//interface clk ,
53
MAC_tx_clk              ,
54
MAC_rx_clk              ,
55
MAC_tx_clk_div  ,
56
MAC_rx_clk_div
57
);
58
input                   Reset                   ;
59
input                   Clk_125M                ;
60
                                //host interface
61
input   [2:0]    Speed                   ;
62
                                //Phy interface                 
63
output                  Gtx_clk                 ;//used only in GMII mode
64
input                   Rx_clk                  ;
65
input                   Tx_clk                  ;//used only in MII mode
66
                                //interface clk signals
67
output                  MAC_tx_clk              ;
68
output                  MAC_rx_clk              ;
69
output                  MAC_tx_clk_div  ;
70
output                  MAC_rx_clk_div  ;
71
 
72
 
73
//******************************************************************************
74
//internal signals                                                              
75
//******************************************************************************
76
wire                    Rx_clk_div2     ;
77
wire                    Tx_clk_div2     ;
78
//******************************************************************************
79
//                                                              
80
//******************************************************************************
81
assign Gtx_clk          =Clk_125M                                       ;
82
assign MAC_rx_clk       =Rx_clk                                         ;
83
 
84
CLK_DIV2 U_0_CLK_DIV2(
85
.IN                             (Rx_clk         ),
86
.OUT            (Rx_clk_div2    )
87
);
88
 
89
CLK_DIV2 U_1_CLK_DIV2(
90
.IN                             (Tx_clk         ),
91
.OUT            (Tx_clk_div2    )
92
);
93
 
94
CLK_SWITCH U_0_CLK_SWITCH(
95
.IN_0                   (Rx_clk_div2    ),
96
.IN_1           (Rx_clk                 ),
97
.SW             (Speed[2]               ),
98
.OUT            (MAC_rx_clk_div )
99
);
100
 
101
CLK_SWITCH U_1_CLK_SWITCH(
102
.IN_0                   (Tx_clk                 ),
103
.IN_1           (Clk_125M               ),
104
.SW             (Speed[2]               ),
105
.OUT            (MAC_tx_clk             )
106
);
107
 
108
 
109
CLK_SWITCH U_2_CLK_SWITCH(
110
.IN_0                   (Tx_clk_div2    ),
111
.IN_1           (Clk_125M               ),
112
.SW             (Speed[2]               ),
113
.OUT            (MAC_tx_clk_div )
114
);
115
endmodule

powered by: WebSVN 2.1.0

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