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

Subversion Repositories fir_wishbone

[/] [fir_wishbone/] [trunk/] [tester/] [tb_fir.vhdl] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 daniel.kho
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.numeric_std.all;
4
 
5
entity tb_fir is end entity tb_fir;
6
 
7
architecture sim of tb_fir is
8
        signal clk,reset:std_ulogic:='0';
9
        signal u: unsigned(16-1 downto 0);
10
        signal y: unsigned(16*2-1 downto 0);
11
        signal count: unsigned(3 downto 0);
12
        signal pwrUpCnt:unsigned(3 downto 0):=(others=>'0');
13
 
14
begin
15
        clk<=not clk after 10 ns;
16
        process(clk) is begin
17
                if pwrUpCnt<10 then reset<='1';
18
                else reset<='0';
19
                end if;
20
        end process;
21
 
22
        fir_test: entity work.fir(rtl)
23
        port map (
24
                reset =>        reset,
25
                clk => clk,
26
 
27
                /* Filter ports. */
28
                u => u,
29
                y => y
30
 
31
        );
32
 
33
        process(reset,clk) is begin
34
                if reset = '1' then count <= (others =>'0');
35
                elsif rising_edge(clk) then
36
                        if count<10 then count<=count+1; end if;
37
                end if;
38
        end process;
39
 
40
        process(clk) is begin
41
                if rising_edge(clk) then
42
                        if pwrUpCnt<10 then pwrUpCnt<=pwrUpCnt+1; end if;
43
                end if;
44
        end process;
45
 
46
        u<= x"0001" when count=5 else x"0000";
47
 
48
end architecture sim;

powered by: WebSVN 2.1.0

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