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

Subversion Repositories mkjpeg

[/] [mkjpeg/] [trunk/] [tb/] [vhdl/] [ClkGen.vhd] - Blame information for rev 25

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 mikel262
 
2
 
3
-------------------------------------------------------------------------------
4
-------------------------------------------------------------------------------
5
----------------------------------- LIBRARY/PACKAGE ---------------------------
6
-------------------------------------------------------------------------------
7
-------------------------------------------------------------------------------
8
 
9
-------------------------------------------------------------------------------
10
-- generic packages/libraries:
11
-------------------------------------------------------------------------------
12
library ieee;
13
        use ieee.std_logic_1164.all;
14
        use ieee.numeric_std.all;
15
 
16
-------------------------------------------------------------------------------
17
-- user packages/libraries:
18
-------------------------------------------------------------------------------
19
 
20
-------------------------------------------------------------------------------
21
-------------------------------------------------------------------------------
22
----------------------------------- ENTITY ------------------------------------
23
-------------------------------------------------------------------------------
24
-------------------------------------------------------------------------------
25
entity ClkGen is
26
        port (
27
             CLK                             : out  std_logic;
28
             RST                             : out  std_logic
29
             );
30
end entity ClkGen;
31
 
32
 
33
-------------------------------------------------------------------------------
34
-------------------------------------------------------------------------------
35
----------------------------------- ARCHITECTURE ------------------------------
36
-------------------------------------------------------------------------------
37
-------------------------------------------------------------------------------
38
architecture ClkGen_rtl of ClkGen is
39
 
40
 
41
        constant CLOCK_PERIOD : time := 10 ns;
42
 
43
        signal clk_s : std_logic := '0';
44
        signal rst_s : std_logic := '0';
45
 
46
 
47
begin
48
 
49
  -- Clock generator (50% duty cycle)
50
        clk_gen: process
51
        begin
52
                clk_s <= '0';
53
                wait for CLOCK_PERIOD/2;
54
                clk_s <= '1';
55
                wait for CLOCK_PERIOD/2;
56
        end process clk_gen;
57
 
58
        CLK <= clk_s;
59
 
60
 
61
        reset_gen: process
62
        begin
63
                wait until rising_edge(clk_s);
64
                rst_s <= '0';
65
                wait until rising_edge(clk_s);
66
                rst_s <= '1';
67
                wait until rising_edge(clk_s);
68
                rst_s <= '0';
69
                wait;
70
        end process reset_gen;
71
 
72
        RST <= rst_s;
73
 
74
 
75
end architecture ClkGen_rtl;

powered by: WebSVN 2.1.0

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