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

Subversion Repositories pdp1

[/] [pdp1/] [trunk/] [rtl/] [vhdl/] [clockdiv.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 yannv
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    11:53:58 02/09/2009 
6
-- Design Name: 
7
-- Module Name:    clockdiv - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
use IEEE.STD_LOGIC_ARITH.ALL;
23
use IEEE.STD_LOGIC_UNSIGNED.ALL;
24
 
25
---- Uncomment the following library declaration if instantiating
26
---- any Xilinx primitives in this code.
27
library UNISIM;
28
use UNISIM.VComponents.all;
29
 
30
entity clockdiv is
31
    Port ( CLK_50M : in  STD_LOGIC;
32
           CLK : out  STD_LOGIC;                -- 2MHz
33
--                        CLK_180 : out std_logic;
34
                          LOCKED : out STD_LOGIC);
35
end clockdiv;
36
 
37
architecture Behavioral of clockdiv is
38
        signal CLK_out : std_logic := '0';
39
begin
40
        LOCKED <= '1';
41
        process (CLK_50M)
42
                -- 50M/25=2M.. should use DCM.
43
                constant top : integer := 25/2-1;
44
                variable count : integer range 0 to top := 0;
45
        begin
46
                if rising_edge(CLK_50M) then
47
                        if count=top then
48
                                CLK_out <= not CLK_out;
49
                                count := 0;
50
                        else
51
                                count := count+1;
52
                        end if;
53
                end if;
54
        end process;
55
 
56
        CLK <= CLK_out;
57
 
58
   -- DCM_SP: Digital Clock Manager Circuit
59
   --         Spartan-3E/3A     (Spartan 3 can't output this low frequency)
60
   -- Xilinx HDL Language Template, version 10.1.3
61
 
62
--   DCM_SP_inst : DCM_SP
63
--   generic map (
64
--      CLKDV_DIVIDE => 2.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
65
--                           --     7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0 or 16.0
66
--      CLKFX_DIVIDE => 25,   --  Can be any interger from 1 to 32
67
--      CLKFX_MULTIPLY => 4, --  Can be any integer from 2 to 32
68
--      CLKIN_DIVIDE_BY_2 => false, --  TRUE/FALSE to enable CLKIN divide by two feature
69
--      CLKIN_PERIOD => 200.0, --  Specify period of input clock in ns
70
--      CLKOUT_PHASE_SHIFT => "NONE", --  Specify phase shift of "NONE", "FIXED" or "VARIABLE" 
71
--      CLK_FEEDBACK => "NONE",         --  Specify clock feedback of "NONE", "1X" or "2X" 
72
--      DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS", -- "SOURCE_SYNCHRONOUS", "SYSTEM_SYNCHRONOUS" or
73
--                                             --     an integer from 0 to 15
74
--      DLL_FREQUENCY_MODE => "LOW",     -- "HIGH" or "LOW" frequency mode for DLL
75
--      DUTY_CYCLE_CORRECTION => TRUE, --  Duty cycle correction, TRUE or FALSE
76
--      PHASE_SHIFT => 0,        --  Amount of fixed phase shift from -255 to 255
77
--      STARTUP_WAIT => TRUE) --  Delay configuration DONE until DCM_SP LOCK, TRUE/FALSE
78
--   port map (
79
----      CLK0 => CLK_2X,     -- 0 degree DCM CLK ouptput
80
----      CLK180 => CLK180, -- 180 degree DCM CLK output
81
----      CLK270 => CLK270, -- 270 degree DCM CLK output
82
----      CLK2X => CLK_400k,   -- 2X DCM CLK output
83
----      CLK2X180 => CLK2X180, -- 2X, 180 degree DCM CLK out
84
----      CLK90 => CLK90,   -- 90 degree DCM CLK output
85
----      CLKDV => CLK_2X,   -- Divided DCM CLK out (CLKDV_DIVIDE)
86
--      CLKFX => CLK,   -- DCM CLK synthesis out (M/D)
87
----      CLKFX180 => CLK_180, -- 180 degree CLK synthesis out
88
--      LOCKED => LOCKED, -- DCM LOCK status output
89
----      PSDONE => PSDONE, -- Dynamic phase adjust done output
90
----      STATUS => STATUS, -- 8-bit DCM status bits output
91
----      CLKFB => CLK,   -- DCM clock feedback
92
--      CLKIN => CLK_out   -- Clock input (from IBUFG, BUFG or DCM)
93
----      PSCLK => PSCLK,   -- Dynamic phase adjust clock input
94
----      PSEN => PSEN,     -- Dynamic phase adjust enable input
95
----      PSINCDEC => PSINCDEC, -- Dynamic phase adjust increment/decrement
96
----      RST => RST        -- DCM asynchronous reset input
97
--   );
98
end Behavioral;

powered by: WebSVN 2.1.0

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