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

Subversion Repositories System09

[/] [System09/] [rev_86/] [rtl/] [VHDL/] [clock_div.vhd] - Blame information for rev 159

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

Line No. Rev Author Line
1 65 davidgb
--===========================================================================----
2
--
3
--  S Y N T H E Z I A B L E    Clock_dll for System09 - SOC.
4
--
5
--===========================================================================----
6
--
7
-- This core adheres to the GNU public license
8
-- No responsibility is taken for this design.
9
-- Use at own risk.  
10
--
11
-- File name       : Clock_dll.vhd
12
--
13
-- Purpose         : Generates Clocks for System09
14
--                   For BurchED B3-Spartan2+ and B5-X300
15
--                   Assumes a 12.5 MHz system clock input
16
--                   Generates a x1 (12.5 MHz) CPU clock 
17
--                   Generates a x2 (25.0 MHz) VGA clock 
18
--                   Generates a x4 (50.0 MHz) MEM clock 
19
--
20
-- Dependencies    : ieee.Std_Logic_1164
21
--                   ieee.std_logic_unsigned
22
--                   ieee.std_logic_arith
23
--                   ieee.numeric_std
24
--
25
--
26
-- Revision History :
27
--
28
--   Rev         : 0.1
29
--   Date        : 7th September 2008
30
--   Description : Initial version.                 
31
-- 
32
--
33
library ieee;
34
   use ieee.std_logic_1164.all;
35
   use IEEE.STD_LOGIC_ARITH.ALL;
36
   use IEEE.STD_LOGIC_UNSIGNED.ALL;
37
   use ieee.numeric_std.all;
38
library unisim;
39
        use unisim.vcomponents.all;
40
 
41
entity clock_div is
42
  port(
43
    clk_in      : in  std_Logic;  -- System Clock input
44
         sys_clk     : out std_logic;  -- System Clock Out    (1/1)
45
         vga_clk     : out std_logic;  -- VGA Pixel Clock Out (1/2)
46
    cpu_clk     : out std_logic   -- CPU Clock Out       (1/4)
47
  );
48
end entity;
49
 
50
architecture RTL of clock_div is
51
 
52
signal div_clk     : std_logic;
53
signal div_count   : std_logic_vector(1 downto 0);
54
 
55
component IBUFG
56
  port (
57
                i: in  std_logic;
58
                o: out std_logic
59
  );
60
end component;
61
 
62
component BUFG
63
  port (
64
                i: in  std_logic;
65
                o: out std_logic
66
  );
67
end component;
68
 
69
 
70
--
71
-- Start instantiation
72
--
73
begin
74
 
75
--
76
-- 50.0MHz  system clock
77
--
78
sys_clk_buffer : IBUFG
79
  port map(
80
    i => clk_in,
81
         o => div_clk
82
  );
83
 
84
--
85
-- 25 MHz VGA clock output
86
--
87
vga_clk_buffer : BUFG
88
  port map(
89
    i => div_count(0),
90
         o => vga_clk
91
  );
92
 
93
--
94
-- 12.5MHz CPU clock 
95
--
96
cpu_clk_buffer : BUFG
97
  port map(
98
    i => div_count(1),
99
         o => cpu_clk
100
  );
101
 
102
--
103
-- Clock divider
104
--
105
clock_div : process( div_clk )
106
begin
107
  if rising_edge( div_clk) then
108
    div_count <= div_count + "01";
109
  end if;
110
  sys_clk <= div_clk;
111
end process;
112
 
113
end architecture;
114
 

powered by: WebSVN 2.1.0

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