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

Subversion Repositories parallel_search_for_maximum_weight

[/] [parallel_search_for_maximum_weight/] [trunk/] [src/] [tb.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 atalla
        library ieee;
2
        use ieee.std_logic_1164.all;
3
        use ieee.numeric_std.all;
4
        use work.basic_size.all;
5
        use work.basic_component.all;
6
        entity tb is
7
        port( clk,reset: in std_logic;
8
                in_data  :      in STD_LOGIC_VECTOR(WIDTH-1 DOWNTO 0);
9
                enable :    in STD_LOGIC_VECTOR(N-1 DOWNTO 0);
10
                output           :  OUT STD_LOGIC_VECTOR(WIDTH-1 DOWNTO 0)
11
                        );
12
        end tb;
13
        architecture behav of tb  is
14
        signal  inputs_reg0 : WORD_ARRAY;
15
        signal  inputs_reg1 : WORD_ARRAY;
16
        signal  outputs_reg0 : STD_LOGIC_VECTOR(WIDTH-1 DOWNTO 0);
17
        signal  outputs_reg1 : STD_LOGIC_VECTOR(WIDTH-1 DOWNTO 0);
18
 
19
        begin
20
-- Serial send the data 
21
         process(clk)
22
                 begin
23
        if clk='1' and clk'event then
24
        for i in 0 to (N-2) loop
25
                 inputs_reg0(i+1) <= inputs_reg0(i) ;
26
                end loop ;
27
                inputs_reg0(0) <= in_data ;
28
                end if;
29
end process;
30
 
31
FIND_MAX :  parallel_find_top PORT MAP
32
        ( a => inputs_reg0,
33
          y => outputs_reg0
34
         );
35
 
36
          process(clk,reset)
37
                 begin
38
                 if reset = '1' then
39
 
40
                 elsif clk='1' and clk'event then
41
                                outputs_reg1 <= outputs_reg0 ;
42
                                output <= outputs_reg1 ;
43
                 end if;
44
                end process;
45
 
46
        end behav;

powered by: WebSVN 2.1.0

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