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 --------------------------------------------------------------------------------
36 uut : entity work.wave_table
40 INIT_FILE => INIT_FILE)
73 --------------------------------------------------------------------------------
77 DAT_I <= (others => '0');
78 ADR_I <= (others => '0');
85 for i in 0 to 2*(WAVE_SIZE-1) loop
86 ADR_I <= conv_std_logic_vector(i, ADR_W);
88 wait until ACK_O = '1';