2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_arith.all;
4 use ieee.std_logic_unsigned.all;
6 entity tb_wave_table is
9 --------------------------------------------------------------------------------
11 architecture testbench of tb_wave_table is
13 constant period : time := 37.5 ns;
14 constant offset : time := 0 us;
16 constant DAT_W : integer := 10;
17 constant ADR_W : integer := 9;
18 constant INIT_FILE : string := "../sin.lut";
20 constant WAVE_SIZE : integer := 2**ADR_W;
23 signal ACK_O : std_logic;
24 signal ADR_I : std_logic_vector (ADR_W-1 downto 0);
25 signal CLK_I : std_logic;
26 signal DAT_I : std_logic_vector (DAT_W-1 downto 0);
27 signal DAT_O : std_logic_vector (DAT_W-1 downto 0);
28 signal STB_I : std_logic;
29 signal WE_I : std_logic;
30 signal RST_I : std_logic;
32 --------------------------------------------------------------------------------
34 component wave_table is
40 ACK_O : out std_logic;
41 ADR_I : in std_logic_vector (ADR_W-1 downto 0);
43 DAT_I : in std_logic_vector (DAT_W-1 downto 0);
44 DAT_O : out std_logic_vector (DAT_W-1 downto 0);
47 end component wave_table;
49 --------------------------------------------------------------------------------
57 INIT_FILE => INIT_FILE)
90 --------------------------------------------------------------------------------
94 DAT_I <= (others => '0');
95 ADR_I <= (others => '0');
102 for i in 0 to 2*(WAVE_SIZE-1) loop
103 ADR_I <= conv_std_logic_vector(i, ADR_W);
105 wait until ACK_O = '1';