1 |
5 |
danv |
-------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- Copyright (C) 2009
|
4 |
|
|
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
5 |
|
|
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
6 |
|
|
--
|
7 |
|
|
-- This program is free software: you can redistribute it and/or modify
|
8 |
|
|
-- it under the terms of the GNU General Public License as published by
|
9 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
10 |
|
|
-- (at your option) any later version.
|
11 |
|
|
--
|
12 |
|
|
-- This program is distributed in the hope that it will be useful,
|
13 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
-- GNU General Public License for more details.
|
16 |
|
|
--
|
17 |
|
|
-- You should have received a copy of the GNU General Public License
|
18 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19 |
|
|
--
|
20 |
|
|
-------------------------------------------------------------------------------
|
21 |
|
|
|
22 |
|
|
LIBRARY IEEE, common_pkg_lib;
|
23 |
|
|
USE IEEE.std_logic_1164.ALL;
|
24 |
|
|
USE common_pkg_lib.common_pkg.ALL;
|
25 |
|
|
|
26 |
|
|
ENTITY tb_tb_common_adder_tree IS
|
27 |
|
|
END tb_tb_common_adder_tree;
|
28 |
|
|
|
29 |
|
|
ARCHITECTURE tb OF tb_tb_common_adder_tree IS
|
30 |
|
|
SIGNAL tb_end : STD_LOGIC := '0'; -- declare tb_end to avoid 'No objects found' error on 'when -label tb_end'
|
31 |
|
|
BEGIN
|
32 |
|
|
-- Usage:
|
33 |
|
|
-- > as 4
|
34 |
|
|
-- > run -all
|
35 |
|
|
|
36 |
|
|
-- g_representation : STRING := "SIGNED";
|
37 |
|
|
-- g_pipeline : NATURAL := 1; -- amount of pipelining per stage
|
38 |
|
|
-- g_nof_inputs : NATURAL := 1; -- >= 1
|
39 |
|
|
-- g_symbol_w : NATURAL := 8;
|
40 |
|
|
-- g_sum_w : NATURAL := 8 -- worst case bit growth requires g_symbol_w + c_nof_stages;
|
41 |
|
|
|
42 |
|
|
gen_nof_inputs : FOR I IN 1 TO 31 GENERATE
|
43 |
|
|
-- SIGNED
|
44 |
|
|
s_pipe_0 : ENTITY work.tb_common_adder_tree GENERIC MAP ("SIGNED", 0, I, 8, 8+ceil_log2(I));
|
45 |
|
|
s_pipe_1 : ENTITY work.tb_common_adder_tree GENERIC MAP ("SIGNED", 1, I, 8, 8+ceil_log2(I));
|
46 |
|
|
s_pipe_2 : ENTITY work.tb_common_adder_tree GENERIC MAP ("SIGNED", 2, I, 8, 8+ceil_log2(I));
|
47 |
|
|
|
48 |
|
|
s_sum_w_0 : ENTITY work.tb_common_adder_tree GENERIC MAP ("SIGNED", 1, I, 8, 8);
|
49 |
|
|
s_sum_w_plus_1 : ENTITY work.tb_common_adder_tree GENERIC MAP ("SIGNED", 1, I, 8, 8+1);
|
50 |
|
|
s_sum_w_min_1 : ENTITY work.tb_common_adder_tree GENERIC MAP ("SIGNED", 1, I, 8, 8-1);
|
51 |
|
|
s_sum_w_wider : ENTITY work.tb_common_adder_tree GENERIC MAP ("SIGNED", 1, I, 8, 8+8);
|
52 |
|
|
|
53 |
|
|
-- UNSIGNED
|
54 |
|
|
u_pipe_0 : ENTITY work.tb_common_adder_tree GENERIC MAP ("UNSIGNED", 0, I, 8, 8+ceil_log2(I));
|
55 |
|
|
u_pipe_1 : ENTITY work.tb_common_adder_tree GENERIC MAP ("UNSIGNED", 1, I, 8, 8+ceil_log2(I));
|
56 |
|
|
u_pipe_2 : ENTITY work.tb_common_adder_tree GENERIC MAP ("UNSIGNED", 2, I, 8, 8+ceil_log2(I));
|
57 |
|
|
|
58 |
|
|
u_sum_w_0 : ENTITY work.tb_common_adder_tree GENERIC MAP ("UNSIGNED", 1, I, 8, 8);
|
59 |
|
|
u_sum_w_plus_1 : ENTITY work.tb_common_adder_tree GENERIC MAP ("UNSIGNED", 1, I, 8, 8+1);
|
60 |
|
|
u_sum_w_min_1 : ENTITY work.tb_common_adder_tree GENERIC MAP ("UNSIGNED", 1, I, 8, 8-1);
|
61 |
|
|
u_sum_w_wider : ENTITY work.tb_common_adder_tree GENERIC MAP ("UNSIGNED", 1, I, 8, 8+8);
|
62 |
|
|
END GENERATE;
|
63 |
|
|
|
64 |
|
|
END tb;
|