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

Subversion Repositories lcd1

[/] [lcd1/] [trunk/] [src/] [BACKUP/] [examle2_tb.vhd] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimo
--------------------------------------------------------------------------------
2
-- Company: TU Chemnitz, SSE
3
-- Engineer: Dimo Pepelyashev
4
--
5
-- Create Date:   17:08:23 03/13/2008
6
-- Design Name:   dff
7
-- Module Name:   dff_tb.vhd
8
-- Project Name:  dff
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- Test Bench for module: dff
14
--
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--------------------------------------------------------------------------------
21
LIBRARY ieee;
22
USE ieee.std_logic_1164.ALL;
23
 
24
ENTITY tlc_tb IS
25
END tcl_tb;
26
 
27
ARCHITECTURE behavior OF tlc_tb IS
28
 
29
        type sample is record
30
                clk : std_logic;
31
                rst : std_logic;
32
                j-left, j_right : std_logic;
33
                led : std_logic_vector (2 downto 0);
34
        end record;
35
 
36
        type sample_array is array(natural range <>) of sample;
37
 
38
        constant test_data : sample_array :=
39
        (       ('1','0','1', '0'),
40
                ('0','0','1', '0'),
41
                ('1','0','0', '0'),
42
                ('0','0','1', '0'),
43
                ('1','0','1', '0'),
44
                ('0','0','1', '0'),
45
                ('1','0','1', '0'),
46
                ('0','0','1', '0'),
47
                ('1','0','1', '1'),
48
                ('0','1','1', '0'),
49
                ('1','1','0', '0'),
50
                ('0','0','1', '0'),
51
                ('1','0','1', '0'),
52
                ('0','0','1', '0'),
53
                ('1','0','0', '0'),
54
                ('0','0','0', '0'),
55
                ('1','0','0', '1'),
56
                ('0','0','0', '0'),
57
                ('1','0','0', '0'),
58
                ('0','0','1', '0'),
59
                ('1','0','1', '0'),
60
                ('0','0','1', '0'),
61
                ('1','0','1', '0')
62
        );
63
 
64
        -- Component Declaration for the Unit Under Test (UUT)
65
        COMPONENT fsm_detector
66
        PORT(
67
                clk : IN std_logic;
68
                rst : in std_logic;
69
                d : in std_logic;
70
                output : out std_logic );
71
        END COMPONENT;
72
 
73
        --Inputs
74
        SIGNAL clk : std_logic := '0';
75
        SIGNAL rst : std_logic := '0';
76
        signal d : std_logic := '0';
77
        --Outputs
78
        SIGNAL output :  std_logic;
79
 
80
 
81
BEGIN
82
uut: fsm_detector                       -- Instantiate the Unit Under Test (UUT)
83
        PORT MAP(       clk => clk,
84
                        rst => rst,
85
                        d => d,
86
                        output => output );
87
 
88
tb: PROCESS
89
        BEGIN
90
                wait for 100 ns;        -- Wait 100 ns for global reset to finish
91
                for i in test_data'range loop
92
                        clk <= test_data(i).clk;
93
                        rst <= test_data(i).rst;
94
                        d <= test_data(i).d;
95
--                      wait for 1 ns;  --dimo
96
                        wait for 2 ns;
97
                        assert output = test_data(i).output
98
                                report "wrong output!"
99
                                severity error;
100
                end loop;
101
                wait;                                   -- will wait forever
102
        END PROCESS;
103
END;

powered by: WebSVN 2.1.0

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