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

Subversion Repositories raytrac

[/] [raytrac/] [trunk/] [tb/] [clock_gen.vhd] - Blame information for rev 121

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

Line No. Rev Author Line
1 52 jguarin200
--! @file clock_gen.vhd
2 37 jguarin200
--! @brief Test bench clock generator.
3
--! @author Julian Andres Guarin Reyes.
4
-- RAYTRAC
5
-- Author Julian Andres Guarin
6 38 jguarin200
-- clockgen.vhd
7 37 jguarin200
-- This file is part of raytrac.
8
-- 
9
--     raytrac is free software: you can redistribute it and/or modify
10
--     it under the terms of the GNU General Public License as published by
11
--     the Free Software Foundation, either version 3 of the License, or
12
--     (at your option) any later version.
13
-- 
14
--     raytrac is distributed in the hope that it will be useful,
15
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
16
--     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
--     GNU General Public License for more details.
18
-- 
19
--     You should have received a copy of the GNU General Public License
20
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>.
21 52 jguarin200
--! Libreria de definicion de senales y tipos estandares, comportamiento de operadores aritmeticos y logicos.
22 38 jguarin200
library ieee;
23 52 jguarin200
--! Paquete de definicion estandard de logica. 
24 38 jguarin200
use ieee.std_logic_1164.all;
25
use work.arithpack.all;
26
 
27
entity clock_gen is
28 49 jguarin200
        generic (tclk : time := tclk);
29 38 jguarin200
        port    (clk,rst : out std_logic);
30
end entity clock_gen;
31
 
32
architecture clock_gen_arch of clock_gen is
33
 
34
 
35
begin
36 52 jguarin200
 
37
        --! Processo de reset, se mantendr&acute; en 0 durante 1 ns, seguido por 1 en 52 ns y finalmente en 0 y se deja ah&iacute;.
38 38 jguarin200
        resetproc: process
39
        begin
40 49 jguarin200
                rst<= not(rstMasterValue);
41
                wait for 1 ns;
42
                rst<= rstMasterValue;
43
                wait for 52 ns;
44
                rst<= not(rstMasterValue);
45 38 jguarin200
                wait;
46 42 jguarin200
        end process resetproc;
47 52 jguarin200
 
48
        --! Proceso de clock, el valor inicial es 1. Inmediatamente baja a 0 y a partir de ah&iacute; con una frecuencia de 50 MHz se genera una se&ntilde;al de clock. 
49 38 jguarin200
        clockproc: process
50 42 jguarin200
        begin
51
 
52
                clk<='1';
53
                clock_loop:
54
                loop
55 49 jguarin200
                        wait for tclk2;
56 42 jguarin200
                        clk<='0';
57 49 jguarin200
                        wait for tclk2;
58 42 jguarin200
                        clk <= '1';
59
                end loop clock_loop;
60
        end process clockproc;
61 49 jguarin200
 
62 42 jguarin200
end clock_gen_arch;
63 38 jguarin200
 
64 42 jguarin200
 
65 38 jguarin200
 
66
 
67
 

powered by: WebSVN 2.1.0

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