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 33

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

powered by: WebSVN 2.1.0

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