blob: afe3672aa3ce61305501c3b4565c7b238acf877f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
library ieee;
use ieee.std_logic_1164.all;
package filtPkg2 is
type std_logic_vector_array is array (integer range <>) of std_logic_vector;
end package filtPkg2;
library ieee;
use ieee.std_logic_1164.all;
use work.filtpkg2.all;
entity filter2 is
generic (
high_g: natural;
low_g: natural
);
port (
clk: in std_ulogic;
c: in std_logic_vector_array
);
end entity filter2;
architecture rtl of filter2
is
signal tmp: std_logic_vector (high_g downto low_g);
begin
tmp <= c (0);
end architecture rtl;
library ieee;
use ieee.std_logic_1164.all;
use work.filtpkg2.all;
entity tb2 is
end entity tb2;
architecture test of tb2
is
constant high_c: natural := 7;
constant low_c: natural := 0;
signal clk: std_ulogic := '0';
signal done: boolean := false;
signal coeff: std_logic_vector_array (0 to 5) (high_c downto low_c) := (others => (others => '0'));
signal tmp: std_logic_vector (high_c downto low_c);
begin
clk <= transport not clk after 10 ns when not done else '0';
done <= transport true after 500 ns;
tmp <= coeff (0);
filter2_1: entity work.filter2
generic map (high_g => high_c, low_g => low_c)
port map (clk => clk, c => coeff);
end architecture test;
|