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

Subversion Repositories System09

[/] [System09/] [trunk/] [rtl/] [System09_Xess_XuLA/] [XuLA_clk.vhd] - Blame information for rev 176

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 122 dilbert57
--=============================================================================--
2
--                                                                             --
3
--  System09 - Synthesizable System On a Chip - XuLA System Clock DCM          --
4
--                                                                             --
5
--=============================================================================--
6
--
7
--
8
-- File name      : XuLA_clk.vhd
9
--
10
-- Entity name    : XuLA_clk
11
--
12
-- Purpose        : Clock module to generate 48MHz SDRAM clock
13
--                  and 24MHz CPU and VDU pixel clock 
14
--                  from the 12MHz PIC FPGA Clock
15
--
16
-- Dependencies   : ieee.Std_Logic_1164
17
--                  ieee.std_logic_unsigned
18
--                  ieee.std_logic_arith
19
--                  ieee.numeric_std
20
--
21
-- Uses           : 
22
--
23
-- Author         : John E. Kent      
24
--                  dilbert57@opencores.org      
25
--
26
--  Copyright (C) 2011 John Kent
27
--
28
--  This program is free software: you can redistribute it and/or modify
29
--  it under the terms of the GNU General Public License as published by
30
--  the Free Software Foundation, either version 3 of the License, or
31
--  (at your option) any later version.
32
--
33
--  This program is distributed in the hope that it will be useful,
34
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
35
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
36
--  GNU General Public License for more details.
37
--
38
--  You should have received a copy of the GNU General Public License
39
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
40
--
41
--===========================================================================--
42
--
43
--                              Revision History:
44
--
45
--===========================================================================--
46
--
47
-- Version 0.1 - 30 April 2011 - John Kent
48
-- Initial version
49
--
50
library ieee;
51
   use ieee.std_logic_1164.all;
52
   use IEEE.STD_LOGIC_ARITH.ALL;
53
   use IEEE.STD_LOGIC_UNSIGNED.ALL;
54
   use ieee.numeric_std.all;
55
library unisim;
56
   use unisim.vcomponents.all;
57
 
58
Entity XuLA_clk is
59
  generic(
60
        FPGA_CLK_FREQ          : integer := 12000000; -- HZ
61
             CPU_CLK_FREQ           : integer := 24000000; -- Hz
62
             VDU_CLK_FREQ           : integer := 24000000; -- Hz
63
                  RAM_CLK_FREQ           : integer := 48000000 -- Hz
64
  );
65
  port(
66
    fpga_clk     : in  std_logic;      -- 12MHz FPGA Clock
67
    cpu_clk      : out std_logic;      -- 24MHz CPU clock
68
    vdu_clk      : out std_logic;      -- 24MHz VDU clock
69
         ram_clk      : out std_logic       -- 48MHz RAM clock
70
    );
71
end XuLA_clk;
72
 
73
Architecture RTL of XuLA_clk is
74
 
75
signal clk12_dcm : std_logic;
76
signal clk24_dcm : std_logic;
77
signal clk48_dcm : std_logic;
78
 
79
component BUFG
80
  port (
81
    I : in  std_logic;
82
    O : out std_logic
83
  );
84
end component;
85
 
86
begin
87
 
88
  DCM_XuLA_inst : DCM
89
   generic map (
90
     DLL_FREQUENCY_MODE    => "LOW", -- "LOW" or "HIGH" 
91
     CLKIN_PERIOD          => 83.3,  -- in nsec 
92
     CLKFX_DIVIDE          => 1,
93
     CLKFX_MULTIPLY        => 4,
94
          CLKDV_DIVIDE          => 2,
95
     CLKIN_DIVIDE_BY_2     => FALSE,
96
     CLKOUT_PHASE_SHIFT    => "NONE",
97
     CLK_FEEDBACK          => "1X",
98
     DESKEW_ADJUST         => "SYSTEM_SYNCHRONOUS",
99
     DFS_FREQUENCY_MODE    => "LOW",
100
     DUTY_CYCLE_CORRECTION => TRUE,
101
     FACTORY_JF            => X"8080",
102
     PHASE_SHIFT           => 0,
103
     STARTUP_WAIT          => FALSE)
104
   port map (
105
     CLKIN      => fpga_clk,     -- input 12MHz
106
     CLKFB      => clk12_dcm,    -- feedback input 
107
     CLK0       => clk12_dcm,    -- Feedback output (phase, freq = input) 
108
     CLK90      => open,         -- Feedback output +  90deg
109
     CLK180     => open,         -- Feedback output + 180deg 
110
     CLK270     => open,         -- Feedback output + 270deg
111
     CLK2X      => clk24_dcm,    -- 2 x input Freq Output 
112
     CLK2X180   => open,         -- 2 x input Freq Output + 180 deg
113
     CLKDV      => open,         -- Fclkdv = Fclkin/CLKDV_DIVIDE 
114
     CLKFX      => clk48_dcm,    -- Fclkfx = Fclkin*CLKFX_MULIPLY/CLKFX_DIVIDE 
115
     CLKFX180   => open,         -- CLKFX180 = CLKFX + 180 degrees 
116
     LOCKED     => open,         -- DCM in lock 
117
     PSDONE     => open,
118
     STATUS     => open,
119
     PSCLK      => open,         -- Clock input to dynamic phase shifter 
120
     PSEN       => open,
121
     PSINCDEC   => open,
122
     RST        => '0'
123
   );
124
 
125
  bufram : BUFG port map(
126
               I => clk48_dcm,
127
               O => ram_clk
128
              );
129
 
130
  bufcpu : BUFG port map (
131
               I => clk24_dcm,
132
               O => cpu_clk
133
              );
134
 
135
  bufvdu : BUFG port map (
136
               I => clk24_dcm,
137
               O => vdu_clk
138
              );
139
 
140
end RTL;

powered by: WebSVN 2.1.0

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