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

Subversion Repositories srdydrdy_lib

[/] [srdydrdy_lib/] [trunk/] [external/] [ethernet_tri_mode/] [Clk_ctrl.v] - Blame information for rev 23

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 23 ghutchis
//////////////////////////////////////////////////////////////////////
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: Clk_ctrl.v,v $
42
// Revision 1.3  2006/01/19 14:07:52  maverickist
43
// verification is complete.
44
//
45
// Revision 1.2  2005/12/16 06:44:13  Administrator
46
// replaced tab with space.
47
// passed 9.6k length frame test.
48
//
49
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
50
// no message
51
// 
52
 
53
module Clk_ctrl(
54
Reset           ,
55
Clk_125M        ,
56
//host interface,
57
Speed           ,
58
//Phy interface ,
59
Gtx_clk         ,
60
Rx_clk          ,
61
Tx_clk          ,
62
//interface clk ,
63
MAC_tx_clk      ,
64
MAC_rx_clk      ,
65
MAC_tx_clk_div  ,
66
MAC_rx_clk_div
67
);
68
input           Reset           ;
69
input           Clk_125M        ;
70
                //host interface
71
input   [2:0]   Speed           ;
72
                //Phy interface         
73
output          Gtx_clk         ;//used only in GMII mode
74
input           Rx_clk          ;
75
input           Tx_clk          ;//used only in MII mode
76
                //interface clk signals
77
output          MAC_tx_clk      ;
78
output          MAC_rx_clk      ;
79
output          MAC_tx_clk_div  ;
80
output          MAC_rx_clk_div  ;
81
 
82
 
83
//******************************************************************************
84
//internal signals                                                              
85
//******************************************************************************
86
wire            Rx_clk_div2 ;
87
wire            Tx_clk_div2 ;
88
//******************************************************************************
89
//                                                              
90
//******************************************************************************
91
assign Gtx_clk      =Clk_125M                   ;
92
assign MAC_rx_clk   =Rx_clk                     ;
93
 
94
CLK_DIV2 U_0_CLK_DIV2(
95
.Reset          (Reset          ),
96
.IN             (Rx_clk         ),
97
.OUT            (Rx_clk_div2    )
98
);
99
 
100
CLK_DIV2 U_1_CLK_DIV2(
101
.Reset          (Reset          ),
102
.IN             (Tx_clk         ),
103
.OUT            (Tx_clk_div2    )
104
);
105
 
106
CLK_SWITCH U_0_CLK_SWITCH(
107
.IN_0           (Rx_clk_div2    ),
108
.IN_1           (Rx_clk         ),
109
.SW             (Speed[2]       ),
110
.OUT            (MAC_rx_clk_div )
111
);
112
 
113
CLK_SWITCH U_1_CLK_SWITCH(
114
.IN_0           (Tx_clk         ),
115
.IN_1           (Clk_125M       ),
116
.SW             (Speed[2]       ),
117
.OUT            (MAC_tx_clk     )
118
);
119
 
120
 
121
CLK_SWITCH U_2_CLK_SWITCH(
122
.IN_0           (Tx_clk_div2    ),
123
.IN_1           (Clk_125M       ),
124
.SW             (Speed[2]       ),
125
.OUT            (MAC_tx_clk_div )
126
);
127
endmodule

powered by: WebSVN 2.1.0

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