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

Subversion Repositories tinyvliw8

[/] [tinyvliw8/] [trunk/] [testbench/] [lib/] [tb_clock32k.vhd] - Blame information for rev 8

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

Line No. Rev Author Line
1 2 steckol
library IEEE;
2
use IEEE.std_logic_1164.all;
3
 
4
entity lib_tb_clock32kHz is
5
        port (
6
                signal clk   : out std_logic;
7
                signal rst_n : out std_logic
8
        );
9
end lib_tb_clock32kHz;
10
 
11
architecture beh of lib_tb_clock32kHz is
12
 
13
component rstCtrl is
14
        port (
15
                rstIn_n  : in std_logic;
16
                clk      : in std_logic;
17
                pol      : in std_logic;  -- polarity of 1st clock edge (0 => falling)
18
 
19
                rstOut_n : out std_logic
20
        );
21
end component;
22
 
23
        signal internal_clk_s : std_logic;
24
        signal rst_n_s        : std_logic;
25
 
26
        signal rstAsync_n_s   : std_logic;
27
 
28
begin
29
 
30
        rst_delay_i: rstCtrl
31
        port map (
32
                rstIn_n  => rstAsync_n_s,
33
                clk      => internal_clk_s,
34
                pol      => '0',
35
 
36
                rstOut_n => rst_n_s
37
        );
38
 
39
        clk <= internal_clk_s;
40
        rst_n <= rst_n_s;
41
 
42
        gen_clk : process
43
        begin
44
                internal_clk_s <= '1';
45
                wait for 15000 ns;
46
                internal_clk_s <= '0';
47
                wait for 15000 ns;
48
        end process;
49
 
50
        gen_rst : process
51
        begin
52
                wait for 1000 ns;
53
                rstAsync_n_s <= '0';
54
                wait for 32000 ns;
55
                rstAsync_n_s <= '1';
56
 
57
                wait;
58
        end process;
59
 
60
end beh;
61
 

powered by: WebSVN 2.1.0

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