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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [testbenches/] [tb_addressgroup.vhd] - Blame information for rev 4

Go to most recent revision | 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_addressgroup
5
--
6
-- PURPOSE:     testbench of addressgroup 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_addressgroup is
17
end tb_addressgroup;
18
 
19
architecture testbench of tb_addressgroup is
20
    component addressgroup
21
        port(   clk:            in std_logic;
22
                address_in:     in std_logic_vector(31 downto 0);
23
                address_out:    out std_logic_vector(31 downto 0);
24
                ic_out:         out std_logic_vector(31 downto 0);
25
                sel_source:     in std_logic;
26
                inc:            in std_logic;
27
                load_ic:        in std_logic;
28
                reset_ic:       in std_logic
29
         );
30
    end component;
31
 
32
    for impl: addressgroup use entity work.addressgroup(rtl);
33
 
34
    signal clk:            std_logic;
35
    signal address_in:     std_logic_vector(31 downto 0);
36
    signal address_out:    std_logic_vector(31 downto 0);
37
    signal ic_out:         std_logic_vector(31 downto 0);
38
    signal sel_source:     std_logic;
39
    signal inc:            std_logic;
40
    signal load_ic:        std_logic;
41
    signal reset_ic:       std_logic := '0';
42
 
43
    constant period     : time := 2ns;
44
 
45
    begin
46
        impl: addressgroup port map (clk => clk, address_in => address_in, address_out => address_out,
47
            ic_out => ic_out, sel_source => sel_source, inc => inc, load_ic => load_ic, reset_ic => reset_ic);
48
    process
49
    begin
50
            wait for 100ns;
51
 
52
            -- 1: load ic, use ic
53
            address_in <= "11010011110100111101001111010011";
54
            load_ic <= '1';
55
            inc <= '0';
56
            sel_source <= '0';
57
 
58
            clk <= '0'; wait for period / 2; clk <= '1'; wait for period / 2;
59
 
60
            assert ic_out = "11010011110100111101001111010011"
61
                report "1 : ic_out"
62
                severity Error;
63
 
64
            assert address_out = "11010011110100111101001111010011"
65
                report "1 : address_out"
66
                severity Error;
67
 
68
            -- 2: dont load ic, use address
69
            address_in <= "00011110000111100001111000011110";
70
            load_ic <= '0';
71
            inc <= '0';
72
            sel_source <= '1';
73
 
74
            clk <= '0'; wait for period / 2; clk <= '1'; wait for period / 2;
75
 
76
            assert ic_out = "11010011110100111101001111010011"
77
                report "2 : ic_out"
78
                severity Error;
79
 
80
            assert address_out = "00011110000111100001111000011110"
81
                report "2 : address_out"
82
                severity Error;
83
 
84
            -- 3: inc ic, use ic
85
            address_in <= "00011110000111100001111000011110";
86
            load_ic <= '0';
87
            inc <= '1';
88
            sel_source <= '0';
89
 
90
            clk <= '0'; wait for period / 2; clk <= '1'; wait for period / 2;
91
 
92
            assert ic_out = "11010011110100111101001111010100"
93
                report "3 : ic_out"
94
                severity Error;
95
 
96
            assert address_out = "11010011110100111101001111010100"
97
                report "3 : address_out"
98
                severity Error;
99
 
100
            -- 4: reset
101
            address_in <= "00011110000111100001111000011110";
102
            load_ic <= '0';
103
            inc <= '0';
104
            sel_source <= '1';
105
            reset_ic <= '1';
106
 
107
            clk <= '0'; wait for period / 2; clk <= '1'; wait for period / 2;
108
 
109
            assert ic_out = "00000000000000000000000000000000"
110
                report "4 : ic_out"
111
                severity Error;
112
 
113
            assert address_out = "00011110000111100001111000011110"
114
                report "4 : address_out"
115
                severity Error;
116
 
117
 
118
            wait;
119
    end process;
120
end;

powered by: WebSVN 2.1.0

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