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

Subversion Repositories sgmii

[/] [sgmii/] [trunk/] [build/] [OpenCore_MAC/] [Clk_ctrl.v] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 jefflieu
//////////////////////////////////////////////////////////////////////
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
// Revision 1.2  2005/12/16 06:44:13  Administrator
43
// replaced tab with space.
44
// passed 9.6k length frame test.
45
//
46
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
47
// no message
48
// 
49
 
50
module Clk_ctrl(
51
Reset           ,
52
Clk_125M        ,
53
Clk_25M,
54
Clk_125M_90,
55
Clk_25M_90,
56
//host interface,
57
Speed           ,
58
//Phy interface ,
59
Gtx_clk         ,
60
Rx_clk          ,
61
//Tx_clk          , //Replace this clock by Clk_25M
62
//interface clk ,
63
MAC_tx_clk_d    ,
64
MAC_tx_clk      ,
65
MAC_rx_clk      ,
66
MAC_tx_clk_div  ,
67
MAC_rx_clk_div
68
);
69
input           Reset           ;
70
input           Clk_125M        ;
71
input                   Clk_25M;
72
input                   Clk_125M_90;
73
input                   Clk_25M_90;
74
 
75
                //host interface
76
input   [2:0]   Speed           ;
77
                //Phy interface         
78
output          Gtx_clk         ;//used only in GMII mode
79
input           Rx_clk          ;
80
//input           Tx_clk          ;//used only in MII mode
81
                //interface clk signals
82
output          MAC_tx_clk      ;
83
output          MAC_rx_clk      ;
84
output          MAC_tx_clk_div  ;
85
output          MAC_rx_clk_div  ;
86
output                  MAC_tx_clk_d;
87
 
88
//******************************************************************************
89
//internal signals                                                              
90
//******************************************************************************
91
wire            Rx_clk_div2 ;
92
wire            Tx_clk_div2 ;
93
wire                    transmit_clk;
94
wire            clk_125_0;
95
wire            clk_125_90;
96
wire            clk_25_0;
97
wire            clk_25_90;
98
 
99
assign clk_125_0        = Clk_125M;
100
assign clk_25_0         = Clk_25M;
101
assign clk_125_90       = Clk_125M_90;
102
assign clk_25_90        = Clk_25M_90;
103
 
104
//******************************************************************************
105
//                                                              
106
//******************************************************************************
107
 
108
assign MAC_rx_clk   =   Rx_clk;
109
assign MAC_tx_clk       =       transmit_clk;
110
assign Gtx_clk          =       transmit_clk;
111
 
112
 
113
 
114
 
115
CLK_DIV2 U_0_CLK_DIV2(
116
.Reset          (Reset          ),
117
.IN             (Rx_clk         ),
118
.OUT            (Rx_clk_div2    )
119
);
120
//
121
CLK_DIV2 U_1_CLK_DIV2(
122
.Reset          (Reset          ),
123
.IN             (clk_25_0       ),
124
.OUT            (Tx_clk_div2    )
125
);
126
//
127
 
128
CLK_SWITCH_ALT2 U_0_CLK_SWITCH(
129
.IN_0           (Rx_clk_div2    ),
130
.IN_1           (Rx_clk         ),
131
.SW             (Speed[2]       ),
132
.OUT            (MAC_rx_clk_div )
133
);
134
 
135
//
136
//CLK_SWITCH_ALT2 U_2_CLK_SWITCH(
137
//.IN_0           (Tx_clk_div2    ),
138
//.IN_1           (clk_125_0      ),
139
//.SW             (Speed[2]       ),
140
//.OUT            ( )
141
//);
142
 
143
assign MAC_tx_clk_div = clk_125_0;
144
 
145
//CLK_SWITCH_ALT2 U_1_CLK_SWITCH(
146
//.IN_0           (clk_25_0             ),
147
//.IN_1           (clk_125_0      ),
148
//.SW             (Speed[2]       ),
149
//.OUT            (transmit_clk )
150
//);
151
 
152
assign transmit_clk = clk_125_0;
153
 
154
 
155
//
156
CLK_SWITCH_ALT2 U_3_CLK_SWITCH(
157
.IN_0           (clk_25_90    ),
158
.IN_1           (clk_125_90     ),
159
.SW             (Speed[2]       ),
160
.OUT            (MAC_tx_clk_d)
161
);
162
 
163
 
164
 
165
 
166
endmodule

powered by: WebSVN 2.1.0

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