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

Subversion Repositories sgmii

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 jefflieu
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// Company: 
4
// Engineer: 
5
// 
6
// Create Date:    10:13:01 06/02/2010 
7
// Design Name: 
8
// Module Name:    Clocks 
9
// Project Name: 
10
// Target Devices: 
11
// Tool versions: 
12
// Description: 
13
//
14
// Dependencies: 
15
//
16
// Revision: 
17
// Revision 0.01 - File Created
18
// Additional Comments: 
19
//
20
//////////////////////////////////////////////////////////////////////////////////
21
module Clocks(
22
    input V4_Clk_125M,
23
    input V4_Clk_27M,
24
    input V4_Clk_13M5,
25
         input V4_Clk_66M,
26
         input [2:0] Speed,
27
    output Clk_125M,
28
    output Clk_27M,
29
    output Clk_13M5,
30
         output Clk_25M,
31
         output Clk_66M,
32
         output Clk_125M_90,
33
         output TxClk,
34
         output TxClk_MAC,
35
    input rst
36
    );
37
 
38
reg  Clk2m5;
39
reg  Clk2m5div2;
40
reg  Clk25div2;
41
wire Clk25div2i;
42
wire Clk2m5i;
43
 
44
wire ClkTx;
45
wire ClkTxdiv2;
46
 
47
wire Clk25, Clk25i;
48
wire Clk125, Clk125i;
49
wire Clk125_90;
50
        // DCM_BASE: Base Digital Clock Manager Circuit
51
   //           Virtex-4/5
52
   // Xilinx HDL Language Template, version 10.1
53
 
54
   DCM_BASE #(
55
      .CLKDV_DIVIDE(5.0), // Divide by: 1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5
56
                          //   7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0 or 16.0
57
      .CLKFX_DIVIDE(5), // Can be any integer from 1 to 32
58
      .CLKFX_MULTIPLY(2), // Can be any integer from 2 to 32
59
      .CLKIN_DIVIDE_BY_2("FALSE"), // TRUE/FALSE to enable CLKIN divide by two feature
60
      .CLKIN_PERIOD(8.0), // Specify period of input clock in ns from 1.25 to 1000.00
61
      .CLKOUT_PHASE_SHIFT("NONE"), // Specify phase shift mode of NONE or FIXED
62
      .CLK_FEEDBACK("1X"), // Specify clock feedback of NONE, 1X or 2X
63
      .DCM_PERFORMANCE_MODE("MAX_SPEED"), // Can be MAX_SPEED or MAX_RANGE
64
      .DESKEW_ADJUST("SYSTEM_SYNCHRONOUS"), // SOURCE_SYNCHRONOUS, SYSTEM_SYNCHRONOUS or
65
                                            //   an integer from 0 to 15
66
      .DFS_FREQUENCY_MODE("LOW"), // LOW or HIGH frequency mode for frequency synthesis
67
      .DLL_FREQUENCY_MODE("LOW"), // LOW, HIGH, or HIGH_SER frequency mode for DLL
68
      .DUTY_CYCLE_CORRECTION("TRUE"), // Duty cycle correction, TRUE or FALSE
69
      .FACTORY_JF(16'hf0f0), // FACTORY JF value suggested to be set to 16'hf0f0
70
      .PHASE_SHIFT(0), // Amount of fixed phase shift from -255 to 1023
71
      .STARTUP_WAIT("FALSE") // Delay configuration DONE until DCM LOCK, TRUE/FALSE
72
   ) DCM_BASE_125M (
73
      .CLK0(Clk125),         // 0 degree DCM CLK output
74
      .CLK180(),     // 180 degree DCM CLK output
75
      .CLK270(),     // 270 degree DCM CLK output
76
      .CLK2X(),       // 2X DCM CLK output
77
      .CLK2X180(), // 2X, 180 degree DCM CLK out
78
      .CLK90(Clk125_90),       // 90 degree DCM CLK output
79
      .CLKDV(Clk25),       // Divided DCM CLK out (CLKDV_DIVIDE)
80
      .CLKFX(),       // DCM CLK synthesis out (M/D)
81
      .CLKFX180(), // 180 degree CLK synthesis out
82
      .LOCKED(),     // DCM LOCK status output
83
      .CLKFB(Clk125i),       // DCM clock feedback
84
      .CLKIN(V4_Clk_125M),       // Clock input (from IBUFG, BUFG or DCM)
85
      .RST(rst)            // DCM asynchronous reset input
86
   );
87
 
88
        BUFG BUFG_inst (
89
      .O(Clk125i),     // Clock buffer output
90
      .I(Clk125)      // Clock buffer input
91
   );
92
 
93
        assign Clk_125M = Clk125i;
94
 
95
        BUFG BUFG25_inst (
96
      .O(Clk25i),     // Clock buffer output
97
      .I(Clk25)      // Clock buffer input
98
   );
99
 
100
        BUFG BUF125_90(
101
        .O(Clk_125M_90),
102
        .I(Clk125_90));
103
 
104
        assign Clk_25M = Clk25i;
105
 
106
   // End of DCM_BASE_inst instantiation
107
 
108
//      always@(posedge Clk25i or posedge rst)
109
//      if(rst)
110
//      begin
111
//      cntr <= 0;
112
//      Clk2m5 <= 0;
113
//      Clk2m5div2 <= 0;
114
//      Clk25div2 <= 0; 
115
//      end
116
//      else
117
//      begin
118
//              if(cntr==9) cntr<=0; else cntr<=cntr+1;
119
//              if(cntr==0 || cntr==5) Clk2m5 <= ~Clk2m5;
120
//              if(cntr==0) Clk2m5div2 <= ~Clk2m5div2;
121
//              Clk25div2 <= ~Clk25div2;
122
//      end
123
 
124
 
125
 
126
endmodule

powered by: WebSVN 2.1.0

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