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

Subversion Repositories all_digital_fm_receiver

[/] [all_digital_fm_receiver/] [trunk/] [circuit_tb.vhd] - Blame information for rev 7

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

Line No. Rev Author Line
1 2 rahmatulla
LIBRARY ieee;
2
USE ieee.std_logic_1164.ALL;
3
USE IEEE.numeric_std.ALL;
4
USE std.textio.ALL;
5
 
6
ENTITY circuit_tb IS
7
END circuit_tb;
8
 
9
ARCHITECTURE behavior OF circuit_tb IS
10
 
11
file vectors: text open read_mode is "fm.txt";
12
 
13
 
14
        COMPONENT circuit
15
        PORT(
16
                clk : IN std_logic;
17
                reset : IN std_logic;
18
                fmin : IN std_logic_vector(7 downto 0);
19
                dmout : OUT std_logic_vector(11 downto 0)
20
                );
21
        END COMPONENT;
22
 
23
        SIGNAL clk :  std_logic := '0' ;
24
        SIGNAL reset    : std_logic := '1';
25
        SIGNAL fmin :  std_logic_vector(7 downto 0);
26
        SIGNAL dmout :  std_logic_vector(11 downto 0);
27
        constant clkperiod : time := 62.5 ns; -- 16 MHz of frequency
28
 
29
BEGIN
30
 
31
        uut: circuit PORT MAP(
32
                clk => clk,
33
                reset => reset,
34
                fmin => fmin,
35
                dmout => dmout
36
        );
37
 
38
    RESET_GEN: process
39
    begin
40
        LOOP1: for N in 0 to 3 loop
41
           wait until falling_edge(CLK);
42
        end loop LOOP1;
43
        RESET <= '0' ;
44
    end process RESET_GEN;
45
 
46
clk <= not clk after clkperiod / 2;
47
 
48
process
49
variable vectorline : line;
50
variable fmin_var : bit_vector(7 downto 0);
51
begin
52
while not endfile(vectors) loop
53
        if (reset = '1') then
54
                        fmin <= (others => '0');
55
        else
56
                        readline(vectors, vectorline);
57
                        read(vectorline, fmin_var);
58
                        fmin <= to_stdlogicvector(fmin_var);
59
        end if;
60
                wait for clkperiod;
61
end loop;
62
end process;
63
 
64
END;

powered by: WebSVN 2.1.0

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