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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [testbenches/] [tb_flag.vhd] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 hmanske
------------------------------------------------------------------
2 4 hmanske
-- PROJECT:     HiCoVec (highly configurable vector processor)
3 2 hmanske
--
4
-- ENTITY:      tb_flag
5
--
6
-- PURPOSE:     testbench of flag entity
7
--
8
-- AUTHOR:      harald manske, haraldmanske@gmx.de
9
--
10
-- VERSION:     1.0
11
-----------------------------------------------------------------
12
library ieee;
13
use ieee.std_logic_1164.all;
14
use ieee.std_logic_unsigned.all;
15
 
16
entity tb_flag is
17
end tb_flag;
18
 
19
architecture testbench of tb_flag is
20
    component flag
21
        port(   clk:        in std_logic;
22
                load:       in std_logic;
23
                data_in:    in std_logic;
24
                data_out:   out std_logic
25
         );
26
    end component;
27
 
28
    for impl: flag use entity work.flag(rtl);
29
 
30
    signal clk:        std_logic;
31
    signal load:       std_logic;
32
    signal data_in:    std_logic;
33
    signal data_out:   std_logic;
34
 
35
    constant period     : time := 2ns;
36
 
37
    begin
38
        impl: flag port map (clk => clk, load => load, data_in => data_in, data_out => data_out);
39
    process
40
    begin
41
            wait for 100ns;
42
 
43
 
44
            -- load 1
45
            data_in <= '1';
46
            load <= '1';
47
 
48
            clk <= '0'; wait for period / 2; clk <= '1'; wait for period / 2;
49
 
50
            assert data_out = '1'
51
                report "load 1 : data_out"
52
                severity Error;
53
 
54
 
55
            -- not load
56
            data_in <= '0';
57
            load <= '0';
58
 
59
            clk <= '0'; wait for period / 2; clk <= '1'; wait for period / 2;
60
 
61
            assert data_out = '1'
62
                report "not load : data_out"
63
                severity Error;
64
 
65
 
66
            -- load 2
67
            data_in <= '0';
68
            load <= '1';
69
 
70
            clk <= '0'; wait for period / 2; clk <= '1'; wait for period / 2;
71
 
72
            assert data_out = '0'
73
                report "load 2 : data_out"
74
                severity Error;
75
 
76
 
77
            wait;
78
 
79
    end process;
80
 
81
end;

powered by: WebSVN 2.1.0

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