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 6

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 6 maverickis
// $Log: not supported by cvs2svn $
42
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
43
// no message
44
// 
45 5 maverickis
 
46
module Clk_ctrl(
47
Reset                   ,
48
Clk_125M                ,
49
//host interface,
50
Speed                   ,
51
//Phy interface ,
52
Gtx_clk                 ,
53
Rx_clk                  ,
54
Tx_clk                  ,
55
//interface clk ,
56
MAC_tx_clk              ,
57
MAC_rx_clk              ,
58
MAC_tx_clk_div  ,
59
MAC_rx_clk_div
60
);
61
input                   Reset                   ;
62
input                   Clk_125M                ;
63
                                //host interface
64
input   [2:0]    Speed                   ;
65
                                //Phy interface                 
66
output                  Gtx_clk                 ;//used only in GMII mode
67
input                   Rx_clk                  ;
68
input                   Tx_clk                  ;//used only in MII mode
69
                                //interface clk signals
70
output                  MAC_tx_clk              ;
71
output                  MAC_rx_clk              ;
72
output                  MAC_tx_clk_div  ;
73
output                  MAC_rx_clk_div  ;
74
 
75
 
76
//******************************************************************************
77
//internal signals                                                              
78
//******************************************************************************
79
wire                    Rx_clk_div2     ;
80
wire                    Tx_clk_div2     ;
81
//******************************************************************************
82
//                                                              
83
//******************************************************************************
84
assign Gtx_clk          =Clk_125M                                       ;
85
assign MAC_rx_clk       =Rx_clk                                         ;
86
 
87
CLK_DIV2 U_0_CLK_DIV2(
88 6 maverickis
.Reset                  (Reset                  ),
89 5 maverickis
.IN                             (Rx_clk         ),
90
.OUT            (Rx_clk_div2    )
91
);
92
 
93
CLK_DIV2 U_1_CLK_DIV2(
94 6 maverickis
.Reset                  (Reset                  ),
95 5 maverickis
.IN                             (Tx_clk         ),
96
.OUT            (Tx_clk_div2    )
97
);
98
 
99
CLK_SWITCH U_0_CLK_SWITCH(
100
.IN_0                   (Rx_clk_div2    ),
101
.IN_1           (Rx_clk                 ),
102
.SW             (Speed[2]               ),
103
.OUT            (MAC_rx_clk_div )
104
);
105
 
106
CLK_SWITCH U_1_CLK_SWITCH(
107
.IN_0                   (Tx_clk                 ),
108
.IN_1           (Clk_125M               ),
109
.SW             (Speed[2]               ),
110
.OUT            (MAC_tx_clk             )
111
);
112
 
113
 
114
CLK_SWITCH U_2_CLK_SWITCH(
115
.IN_0                   (Tx_clk_div2    ),
116
.IN_1           (Clk_125M               ),
117
.SW             (Speed[2]               ),
118
.OUT            (MAC_tx_clk_div )
119
);
120
endmodule

powered by: WebSVN 2.1.0

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